| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- name: Docker Image
- on:
- release:
- types: [created]
- env:
- REGISTRY: ghcr.io
- IMAGE_NAME: ${{ github.repository }}
- jobs:
- build:
- runs-on: ubuntu-latest
- permissions:
- contents: read
- packages: write
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
- - name: Log into registry ${{ env.REGISTRY }}
- uses: docker/login-action@v1
- with:
- registry: ${{ env.REGISTRY }}
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
- - name: Extract Docker metadata
- id: meta
- uses: docker/metadata-action@v3
- with:
- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- tags: |
- type=ref,event=branch
- type=ref,event=pr
- type=semver,pattern={{version}}
- - name: Build and push Docker image
- uses: docker/build-push-action@v2
- with:
- context: .
- push: true
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
- build-args: |
- VERSION=${{ steps.meta.outputs.version }}
|