blob: f7c59deac8e93110d39ca76a31c258ff5e38a2c3 [file] [log] [blame]
Varun Patil6ba08cd2023-11-18 13:54:52 -08001name: Publish Docker image
Varun Patil6ba08cd2023-11-18 13:54:52 -08002on:
3 push:
4 branches:
5 - master
6 paths-ignore:
7 - '*.md'
Davide Pesaventocaa60cc2024-02-18 18:18:37 -05008 - '.jenkins'
9 - '.jenkins.d/**'
Varun Patil6ba08cd2023-11-18 13:54:52 -080010 - '.mailmap'
Davide Pesaventocaa60cc2024-02-18 18:18:37 -050011 - 'tests/**'
Varun Patil6ba08cd2023-11-18 13:54:52 -080012 workflow_dispatch:
13
14permissions:
15 contents: read
16 packages: write
17
18env:
19 REGISTRY: ghcr.io
Varun Patil6ba08cd2023-11-18 13:54:52 -080020
21jobs:
Varun Patil23135a42023-11-18 15:12:42 -080022 nfd:
Varun Patil6ba08cd2023-11-18 13:54:52 -080023 runs-on: ubuntu-latest
24 steps:
25 - name: Checkout repository
26 uses: actions/checkout@v4
27 with:
28 submodules: true
29
30 - name: Login to ${{ env.REGISTRY }}
31 uses: docker/login-action@v3
32 with:
33 registry: ${{ env.REGISTRY }}
34 username: ${{ github.actor }}
35 password: ${{ secrets.GITHUB_TOKEN }}
36
37 - name: Extract metadata
38 id: meta
39 uses: docker/metadata-action@v5
40 with:
Varun Patil23135a42023-11-18 15:12:42 -080041 images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/nfd
Varun Patil6ba08cd2023-11-18 13:54:52 -080042 flavor: latest=true
43
44 - name: Build and push Docker image
45 uses: docker/build-push-action@v5
46 with:
47 context: .
48 pull: true
49 push: true
50 tags: ${{ steps.meta.outputs.tags }}
51 labels: ${{ steps.meta.outputs.labels }}
Varun Patil23135a42023-11-18 15:12:42 -080052
53 nfd-status-http-server:
54 needs: nfd
55 runs-on: ubuntu-latest
56
57 steps:
58 - name: Checkout repository
59 uses: actions/checkout@v4
60
61 - name: Login to ${{ env.REGISTRY }}
62 uses: docker/login-action@v3
63 with:
64 registry: ${{ env.REGISTRY }}
65 username: ${{ github.actor }}
66 password: ${{ secrets.GITHUB_TOKEN }}
67
68 - name: Extract metadata
69 id: meta
70 uses: docker/metadata-action@v5
71 with:
72 images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/nfd-status-http-server
73 flavor: latest=true
74
75 - name: Build and push Docker image
76 uses: docker/build-push-action@v5
77 with:
78 context: ./tools
79 file: ./tools/Dockerfile.nfd-status-http-server
80 pull: true
81 push: true
82 tags: ${{ steps.meta.outputs.tags }}
83 labels: ${{ steps.meta.outputs.labels }}