github.com/go-graphite/carbonapi@v0.17.0/.github/workflows/docker-ghcrio.yml (about) 1 name: Upload Docker images to ghcr.io 2 on: 3 release: 4 types: [created] 5 jobs: 6 docker: 7 name: Build image 8 runs-on: ubuntu-latest 9 steps: 10 - name: Check out code 11 uses: actions/checkout@v4 12 - name: Docker meta 13 id: meta 14 uses: docker/metadata-action@v5 15 with: 16 images: ghcr.io/${{ github.repository }} 17 # create latest tag for branch events 18 flavor: | 19 latest=auto 20 tags: | 21 type=ref,event=branch 22 type=ref,event=pr 23 type=semver,pattern={{version}} 24 type=semver,pattern={{major}}.{{minor}} 25 type=semver,pattern={{major}}.{{minor}}.{{patch}} 26 - name: Login to ghcr.io 27 uses: docker/login-action@v3 28 with: 29 registry: ghcr.io 30 username: ${{ github.actor }} 31 password: ${{ secrets.GITHUB_TOKEN }} 32 - name: Build and push 33 id: docker_build 34 uses: docker/build-push-action@v5 35 with: 36 # push for non-pr events 37 push: ${{ github.event_name != 'pull_request' }} 38 context: . 39 tags: ${{ steps.meta.outputs.tags }} 40 labels: ${{ steps.meta.outputs.labels }}