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 888d94c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Debug
run: ${{ tojson(github.event) }}
shell: cat {0}

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

Expand All @@ -37,5 +41,5 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: guilt-spark-build
name: guilt-spark-build-${{ github.sha }}
path: ./dist
21 changes: 10 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ 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
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Set up Node.js
uses: actions/setup-node@v4
Expand All @@ -25,20 +31,12 @@ jobs:
- name: Install Node.js dependencies
run: npm ci

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: guilt-spark-build
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 All @@ -52,6 +50,7 @@ jobs:
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
XBOX_USERNAME: ${{ vars.XBOX_USERNAME }}
XBOX_PASSWORD: ${{ secrets.XBOX_PASSWORD }}

deploy-cancel:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
Expand Down

0 comments on commit 888d94c

Please sign in to comment.