Validate tag #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy DNS Bot | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| name: Deploy | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check required secrets | |
| run: | | |
| if [ -z "${{ secrets.CLOUDFLARE_API_TOKEN }}" ]; then | |
| echo "❌ CLOUDFLARE_API_TOKEN is not set" | |
| exit 1 | |
| fi | |
| if [ -z "${{ secrets.DISCORD_WEBHOOK_URL }}" ]; then | |
| echo "❌ DISCORD_WEBHOOK_URL is not set" | |
| exit 1 | |
| fi | |
| # DISCORD_ROLE_ID is optional | |
| if [ -n "${{ secrets.DISCORD_ROLE_ID }}" ]; then | |
| echo "✅ DISCORD_ROLE_ID is set" | |
| else | |
| echo "ℹ️ DISCORD_ROLE_ID is not set (optional)" | |
| fi | |
| echo "✅ All required secrets are set" | |
| - name: Deploy to Cloudflare Workers | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| DISCORD_ROLE_ID: ${{ secrets.DISCORD_ROLE_ID }} | |
| run: npm run deploy |