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