blob: 53554dfbab7ecbf692609c726e532bf8a0614910 [file] [log] [blame]
Davide Pesavento183e1882024-04-09 15:56:32 -04001name: Docker
Varun Patil6ba08cd2023-11-18 13:54:52 -08002on:
3 push:
4 branches:
5 - master
6 paths-ignore:
Davide Pesavento183e1882024-04-09 15:56:32 -04007 - '.editorconfig'
Davide Pesaventocaa60cc2024-02-18 18:18:37 -05008 - '.jenkins'
9 - '.jenkins.d/**'
Davide Pesavento183e1882024-04-09 15:56:32 -040010 - 'launchd/**'
Varun Patil6ba08cd2023-11-18 13:54:52 -080011 - '.mailmap'
Davide Pesavento183e1882024-04-09 15:56:32 -040012 - 'systemd/**'
Davide Pesaventocaa60cc2024-02-18 18:18:37 -050013 - 'tests/**'
Varun Patil6ba08cd2023-11-18 13:54:52 -080014 workflow_dispatch:
15
16permissions:
Varun Patil6ba08cd2023-11-18 13:54:52 -080017 packages: write
18
19env:
20 REGISTRY: ghcr.io
Varun Patil6ba08cd2023-11-18 13:54:52 -080021
22jobs:
Varun Patil23135a42023-11-18 15:12:42 -080023 nfd:
Varun Patil6ba08cd2023-11-18 13:54:52 -080024 runs-on: ubuntu-latest
25 steps:
26 - name: Checkout repository
27 uses: actions/checkout@v4
28 with:
29 submodules: true
30
31 - name: Login to ${{ env.REGISTRY }}
32 uses: docker/login-action@v3
33 with:
34 registry: ${{ env.REGISTRY }}
35 username: ${{ github.actor }}
36 password: ${{ secrets.GITHUB_TOKEN }}
37
38 - name: Extract metadata
39 id: meta
40 uses: docker/metadata-action@v5
41 with:
Varun Patil23135a42023-11-18 15:12:42 -080042 images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/nfd
Varun Patil6ba08cd2023-11-18 13:54:52 -080043 flavor: latest=true
44
45 - name: Build and push Docker image
46 uses: docker/build-push-action@v5
47 with:
48 context: .
49 pull: true
50 push: true
51 tags: ${{ steps.meta.outputs.tags }}
52 labels: ${{ steps.meta.outputs.labels }}
Varun Patil23135a42023-11-18 15:12:42 -080053
54 nfd-status-http-server:
55 needs: nfd
56 runs-on: ubuntu-latest
57
58 steps:
59 - name: Checkout repository
60 uses: actions/checkout@v4
61
62 - name: Login to ${{ env.REGISTRY }}
63 uses: docker/login-action@v3
64 with:
65 registry: ${{ env.REGISTRY }}
66 username: ${{ github.actor }}
67 password: ${{ secrets.GITHUB_TOKEN }}
68
69 - name: Extract metadata
70 id: meta
71 uses: docker/metadata-action@v5
72 with:
73 images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/nfd-status-http-server
74 flavor: latest=true
75
76 - name: Build and push Docker image
77 uses: docker/build-push-action@v5
78 with:
79 context: ./tools
80 file: ./tools/Dockerfile.nfd-status-http-server
81 pull: true
82 push: true
83 tags: ${{ steps.meta.outputs.tags }}
84 labels: ${{ steps.meta.outputs.labels }}