Davide Pesavento | 183e188 | 2024-04-09 15:56:32 -0400 | [diff] [blame] | 1 | name: Docker |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 2 | on: |
| 3 | push: |
| 4 | branches: |
| 5 | - master |
| 6 | paths-ignore: |
Davide Pesavento | 183e188 | 2024-04-09 15:56:32 -0400 | [diff] [blame] | 7 | - '.editorconfig' |
Davide Pesavento | caa60cc | 2024-02-18 18:18:37 -0500 | [diff] [blame] | 8 | - '.jenkins' |
| 9 | - '.jenkins.d/**' |
Davide Pesavento | 183e188 | 2024-04-09 15:56:32 -0400 | [diff] [blame] | 10 | - 'launchd/**' |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 11 | - '.mailmap' |
Davide Pesavento | 183e188 | 2024-04-09 15:56:32 -0400 | [diff] [blame] | 12 | - 'systemd/**' |
Davide Pesavento | caa60cc | 2024-02-18 18:18:37 -0500 | [diff] [blame] | 13 | - 'tests/**' |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 14 | workflow_dispatch: |
| 15 | |
| 16 | permissions: |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 17 | packages: write |
| 18 | |
| 19 | env: |
| 20 | REGISTRY: ghcr.io |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 21 | |
| 22 | jobs: |
Varun Patil | 23135a4 | 2023-11-18 15:12:42 -0800 | [diff] [blame] | 23 | nfd: |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 24 | 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 Patil | 23135a4 | 2023-11-18 15:12:42 -0800 | [diff] [blame] | 42 | images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/nfd |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 43 | 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 Patil | 23135a4 | 2023-11-18 15:12:42 -0800 | [diff] [blame] | 53 | |
| 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 }} |