decentralised sync engine
1name: Build and Push Docker Image
2
3on:
4 push:
5 tags:
6 - "v*"
7
8env:
9 REGISTRY: ghcr.io
10 IMAGE_NAME: ${{ github.repository }}
11
12jobs:
13 build-and-push:
14 runs-on: ubuntu-latest
15 permissions:
16 contents: read
17 packages: write
18
19 steps:
20 - name: Checkout repository
21 uses: actions/checkout@v4
22
23 - name: Log in to GitHub Container Registry
24 uses: docker/login-action@v3
25 with:
26 registry: ${{ env.REGISTRY }}
27 username: ${{ github.actor }}
28 password: ${{ secrets.GITHUB_TOKEN }}
29
30 - name: Extract metadata (tags, labels)
31 id: meta
32 uses: docker/metadata-action@v5
33 with:
34 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35 tags: |
36 type=semver,pattern={{version}}
37 type=semver,pattern={{major}}.{{minor}}
38 type=semver,pattern={{major}}
39 type=raw,value=latest
40
41 - name: Build and push Docker image
42 uses: docker/build-push-action@v5
43 with:
44 context: .
45 push: true
46 tags: ${{ steps.meta.outputs.tags }}
47 labels: ${{ steps.meta.outputs.labels }}