name: release on: workflow_dispatch: push: branches: - main tags: - 'v*' env: IMAGE_NAME: ghcr.io/${{ github.repository }} TAG: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || github.sha }} jobs: release: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - uses: actions/checkout@v4 - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Fetch extensions run: ./fetch.sh - name: Build the container run: ./build.sh "$IMAGE_NAME" "$TAG" - name: Publish the container run: | docker push "$IMAGE_NAME:$TAG" if [[ "${{ github.ref }}" == refs/tags/* ]]; then docker tag "$IMAGE_NAME:$TAG" "$IMAGE_NAME:latest" docker push "$IMAGE_NAME:latest" fi