Skip to content

Commit

Permalink
fix deploy environment
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhouweling committed Nov 5, 2024
1 parent ef07a62 commit fbe5508
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: guilt-spark-build
name: guilt-spark-build-${{ github.sha }}
path: ./dist
13 changes: 8 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }}
environment: ${{ github.event.workflow_run.head_branch == 'main' && 'production' || 'staging' }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 60
timeout-minutes: 10
steps:
- name: Debug
run: ${{ tojson(github.event) }}
shell: cat {0}

- name: Check out Git repository
uses: actions/checkout@v4

Expand All @@ -28,17 +32,16 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: guilt-spark-build
name: guilt-spark-build-${{ github.event.workflow_run.head_commit.id }}
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Deploy Worker
uses: cloudflare/wrangler-action@v3
with:
wranglerVersion: 3.84.1
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }}
environment: ${{ github.event.workflow_run.head_branch == 'main' && 'production' || 'staging' }}
vars: |
DISCORD_APP_ID
DISCORD_PUBLIC_KEY
Expand Down

0 comments on commit fbe5508

Please sign in to comment.