blob: e324a31c19e9fb6a8c9f7d4515860c9aabc2ebe9 [file] [log] [blame]
Varun Patile58bab22023-11-18 13:09:13 -08001name: Publish Docker image
Varun Patile58bab22023-11-18 13:09:13 -08002on:
3 push:
4 branches:
5 - master
Davide Pesavento6d4a6532023-11-18 17:05:33 -05006 paths-ignore:
7 - '*.md'
Davide Pesavento682b2af2024-02-23 21:25:41 -05008 - '.jenkins'
9 - '.jenkins.d/**'
Davide Pesavento6d4a6532023-11-18 17:05:33 -050010 - '.mailmap'
Davide Pesavento682b2af2024-02-23 21:25:41 -050011 - 'tests/**'
Varun Patile58bab22023-11-18 13:09:13 -080012 workflow_dispatch:
13
Davide Pesavento6d4a6532023-11-18 17:05:33 -050014permissions:
15 contents: read
16 packages: write
17
Varun Patile58bab22023-11-18 13:09:13 -080018env:
19 REGISTRY: ghcr.io
Varun Patile58bab22023-11-18 13:09:13 -080020
21jobs:
22 publish:
23 runs-on: ubuntu-latest
Varun Patile58bab22023-11-18 13:09:13 -080024 steps:
25 - name: Checkout repository
26 uses: actions/checkout@v4
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
Davide Pesavento6d4a6532023-11-18 17:05:33 -050035 - name: Extract metadata
Varun Patile58bab22023-11-18 13:09:13 -080036 id: meta
37 uses: docker/metadata-action@v5
38 with:
Davide Pesavento682b2af2024-02-23 21:25:41 -050039 images: ${{ env.REGISTRY }}/${{ github.repository }}
Davide Pesavento6d4a6532023-11-18 17:05:33 -050040 flavor: latest=true
Varun Patile58bab22023-11-18 13:09:13 -080041
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 }}
Davide Pesavento6d4a6532023-11-18 17:05:33 -050049 labels: ${{ steps.meta.outputs.labels }}