diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5717c00..a9b711e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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: @@ -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' }} diff --git a/README.md b/README.md index 6b6c882..fae1e20 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/b38b0d0 b/b38b0d0 new file mode 160000 index 0000000..b38b0d0 --- /dev/null +++ b/b38b0d0 @@ -0,0 +1 @@ +Subproject commit b38b0d04d8308aebf5a7fdf2fa9c9ae28e5ee29c