name: docker on: push: branches: - "master" - "develop" tags: - 'v*' pull_request: permissions: packages: write contents: read jobs: docker: name: Build and publish Docker images runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata id: meta uses: docker/metadata-action@v3 with: images: ghcr.io/autobrr/autobrr - name: Build and publish image id: docker_build uses: docker/build-push-action@v2 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }} VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} REVISION=${{ github.event.pull_request.head.sha }} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }}