Skip to content

Commit

Permalink
Fix deployment not working (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhouweling authored Nov 4, 2024
1 parent e2211bb commit e892e5b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
name: Deply
name: Deploy

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

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.pull_request.base.ref == 'main' && 'production' || 'staging' }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 60
steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"

- name: Install Node.js dependencies
run: npm ci

- name: Download artifacts
uses: actions/download-artifact@v4
with:
Expand All @@ -24,6 +39,19 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
vars: |
DISCORD_APP_ID
DISCORD_PUBLIC_KEY
XBOX_USERNAME
secrets: |
DISCORD_TOKEN
XBOX_PASSWORD
env:
DISCORD_APP_ID: ${{ vars.DISCORD_APP_ID }}
DISCORD_PUBLIC_KEY: ${{ vars.DISCORD_PUBLIC_KEY }}
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ This Discord bot can pull stats from Halo Waypoint and post accordingly.
1. [Download and install node.js](https://nodejs.org/en/download/package-manager) if you haven't done already
2. Clone the repo (assuming you already know how)
3. Follow the instructions from [`discord/cloudflare-sample-app`](https://github.com/discord/cloudflare-sample-app)
a. [Configuring project](https://github.com/discord/cloudflare-sample-app?tab=readme-ov-file#configuring-project)
b. [Creating your Cloudflare worker](https://github.com/discord/cloudflare-sample-app?tab=readme-ov-file#creating-your-cloudflare-worker)
c. [Running locally](https://github.com/discord/cloudflare-sample-app?tab=readme-ov-file#running-locally)
1. [Configuring project](https://github.com/discord/cloudflare-sample-app?tab=readme-ov-file#configuring-project)
2. [Creating your Cloudflare worker](https://github.com/discord/cloudflare-sample-app?tab=readme-ov-file#creating-your-cloudflare-worker)
3. [Running locally](https://github.com/discord/cloudflare-sample-app?tab=readme-ov-file#running-locally)

Now in a channel you can use `/stats` command.

Expand Down
1 change: 1 addition & 0 deletions b38b0d0
Submodule b38b0d0 added at b38b0d

0 comments on commit e892e5b

Please sign in to comment.