Skip to content

feat: Update Cloudflare Workers deployment workflow to include reposi… #3

feat: Update Cloudflare Workers deployment workflow to include reposi…

feat: Update Cloudflare Workers deployment workflow to include reposi… #3

Workflow file for this run

name: Deploy Cloudflare Worker and Run Discord Script
on:
push:
branches:
- main # Deploy on push to the main branch
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install dependencies
run: npm install
- name: Install Wrangler
run: npm install -g wrangler
- name: Extract repository name
id: extract
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Publish to Cloudflare Workers
env:
CF_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CF_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: wrangler deploy src/index.js --name ${{ env.REPO_NAME }}
- name: Run Discord script
env:
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
GUILD_ID: ${{ secrets.GUILD_ID }}
run: npm run discord