Skip to content

Commit

Permalink
Actually fix default branch detection
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-roesch committed Sep 6, 2024
1 parent bc8499e commit b3bfe4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
images: |
ghcr.io/${{ github.repository_owner }}/roshar-map
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/head/{0}', github.event.repository.default_branch) }}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == format('refs/head/{0}', github.event.repository.default_branch))
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == format('refs/heads/{0}', github.event.repository.default_branch))
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -42,7 +42,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == format('refs/head/{0}', github.event.repository.default_branch)) }}
push: ${{ github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == format('refs/heads/{0}', github.event.repository.default_branch)) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand All @@ -53,7 +53,7 @@ jobs:
with:
context: .
file: Dockerfile-dev
push: ${{ github.ref == format('refs/head/{0}', github.event.repository.default_branch) }}
push: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
tags: ghcr.io/${{ github.repository_owner }}/roshar-map:latest-dev
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand All @@ -65,7 +65,7 @@ jobs:
runs-on: ubuntu-latest
needs: [build]

if: github.event_name == 'push' && github.ref == format('refs/head/{0}', github.event.repository.default_branch) && (contains(github.event.head_commit.message, '[deploy-dev]') || contains(github.event.head_commit.message, '[deploy]'))
if: github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && (contains(github.event.head_commit.message, '[deploy-dev]') || contains(github.event.head_commit.message, '[deploy]'))

steps:
- name: Setup SSH Keys and known_hosts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
path: 'dist/release'

deploy:
if: (github.event_name == 'push' && github.ref == format('refs/head/{0}', github.event.repository.default_branch) && contains(github.event.head_commit.message, '[deploy]'))
if: (github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && contains(github.event.head_commit.message, '[deploy]'))
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy)

needs: build
Expand Down

0 comments on commit b3bfe4f

Please sign in to comment.