Skip to content

Commit

Permalink
setup deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhouweling committed Nov 3, 2024
1 parent 25aa6d5 commit 5fa87db
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
node-version: 20
cache: "npm"

# ESLint and Prettier must be in `package.json`
- name: Install Node.js dependencies
run: npm ci

Expand All @@ -32,3 +31,8 @@ jobs:

- name: Run build
run: npm run build

- uses: actions/upload-artifact@v4
with:
name: guilt-spark-build
path: ./dist
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deply

on:
workflow_run:
workflows: [Build]
types: [completed]

jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 60
steps:
- 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 }}

- uses: actions/checkout@v4
- name: Build & Deploy Worker
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
deploy-cancel:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The triggering workflow failed'
- run: exit 1
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"lint": "npx eslint .",
"lint:fix": "npx eslint . --fix",
"build:generate-types": "wrangler types --experimental-include-runtime",
"build": "tsc --project tsconfig.build.json"
"build": "tsc --project tsconfig.build.json",
"publish": "wrangler deploy"
},
"dependencies": {
"@xboxreplay/xboxlive-auth": "^4.0.0",
Expand Down

0 comments on commit 5fa87db

Please sign in to comment.