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