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