blob: a34fdc89e6abe3903ead432f4153fb13f5eb0165 [file] [log] [blame]
Varun Patile58bab22023-11-18 13:09:13 -08001name: Publish Docker image
2
3on:
4 push:
5 branches:
6 - master
7 workflow_dispatch:
8
9env:
10 REGISTRY: ghcr.io
11 IMAGE_NAME: ${{ github.repository }}
12
13jobs:
14 publish:
15 runs-on: ubuntu-latest
16 permissions:
17 contents: read
18 packages: write
19
20 steps:
21 - name: Checkout repository
22 uses: actions/checkout@v4
23
24 - name: Login to ${{ env.REGISTRY }}
25 uses: docker/login-action@v3
26 with:
27 registry: ${{ env.REGISTRY }}
28 username: ${{ github.actor }}
29 password: ${{ secrets.GITHUB_TOKEN }}
30
31 - name: Extract metadata for Docker
32 id: meta
33 uses: docker/metadata-action@v5
34 with:
35 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
36
37 - name: Build and push Docker image
38 uses: docker/build-push-action@v5
39 with:
40 context: .
41 pull: true
42 push: true
43 tags: ${{ steps.meta.outputs.tags }}
44 labels: ${{ steps.meta.outputs.labels }}