Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deployment not working #16

Merged
merged 5 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading