blob: d21badde32fbbdaf5ae825d0a4683aeafa2d0f76 [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: .
Davide Pesavento01d0aa62024-04-12 00:30:05 -040049 target: nfd
Varun Patil6ba08cd2023-11-18 13:54:52 -080050 pull: true
51 push: true
52 tags: ${{ steps.meta.outputs.tags }}
53 labels: ${{ steps.meta.outputs.labels }}
Varun Patil23135a42023-11-18 15:12:42 -080054
55 nfd-status-http-server:
Varun Patil23135a42023-11-18 15:12:42 -080056 runs-on: ubuntu-latest
Varun Patil23135a42023-11-18 15:12:42 -080057 steps:
58 - name: Checkout repository
59 uses: actions/checkout@v4
Davide Pesavento01d0aa62024-04-12 00:30:05 -040060 with:
61 submodules: true
Varun Patil23135a42023-11-18 15:12:42 -080062
63 - name: Login to ${{ env.REGISTRY }}
64 uses: docker/login-action@v3
65 with:
66 registry: ${{ env.REGISTRY }}
67 username: ${{ github.actor }}
68 password: ${{ secrets.GITHUB_TOKEN }}
69
70 - name: Extract metadata
71 id: meta
72 uses: docker/metadata-action@v5
73 with:
74 images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/nfd-status-http-server
75 flavor: latest=true
76
77 - name: Build and push Docker image
78 uses: docker/build-push-action@v5
79 with:
Davide Pesavento01d0aa62024-04-12 00:30:05 -040080 context: .
81 target: nfd-status-http-server
Varun Patil23135a42023-11-18 15:12:42 -080082 pull: true
83 push: true
84 tags: ${{ steps.meta.outputs.tags }}
85 labels: ${{ steps.meta.outputs.labels }}