diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7f512ee..0a339c9 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -11,6 +11,7 @@ jobs: test: name: Test runs-on: ubuntu-latest + if: github.server_url == 'https://github.com' steps: - uses: actions/checkout@v4 @@ -34,6 +35,7 @@ jobs: lint: name: Lint runs-on: ubuntu-latest + if: github.server_url == 'https://github.com' steps: - uses: actions/checkout@v4 @@ -57,7 +59,7 @@ jobs: name: Build and Push Docker Image runs-on: ubuntu-latest needs: [test, lint] - if: github.event_name == 'push' + if: github.event_name == 'push' && github.server_url == 'https://github.com' permissions: contents: read packages: write @@ -78,10 +80,10 @@ jobs: with: images: ghcr.io/${{ github.repository }} tags: | - type=ref,event=branch type=ref,event=tag - type=sha + type=sha,prefix=sha- type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=stable,enable=${{ startsWith(github.ref, 'refs/tags/v') }} - name: Build and push uses: docker/build-push-action@v5