Add OAuth 2.0 verification #40
This file contains 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
# Workflow for deploying a static site to GitHub Pages | |
name: Deploy to GitHub Pages | |
on: | |
# Trigger deployment on pushes to the `main` branch | |
# Runs on pushes targeting the default branch | |
push: | |
branches: [ "main" ] | |
paths-ignore: | |
- '**.md' | |
pull_request_target: | |
branches: [ "main" ] | |
paths-ignore: | |
- '**.md' | |
# Allow manual runs from the GitHub Actions tab | |
workflow_dispatch: | |
permissions: | |
contents: read # Read access to the repository contents | |
pages: write # Write access to the GitHub Pages | |
id-token: write # Required for GitHub Pages deployment | |
# Allow only one concurrent deployment, skipping runs queued between the run in progress and latest queued. | |
concurrency: | |
group: "deploy" | |
cancel-in-progress: false | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the code | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Set up Node.js environment | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
# Cache node_modules to speed up future installs | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-modules- | |
# Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# Build the app with environment variables | |
- name: Build the app | |
env: | |
VITE_DEBUG_MODE: ${{ vars.VITE_DEBUG_MODE || 'false' }} | |
VITE_VALIDATE_PROMOTION_CODE_API: ${{ vars.VITE_VALIDATE_PROMOTION_CODE_API || 'https://chubgame.com/wp-json/chubgame/v1/validate' }} | |
VITE_SEND_DICE_DATA_API: ${{ vars.VITE_SEND_DICE_DATA_API || 'https://chubgame.com/wp-json/chubgame/v1/send' }} | |
VITE_CHECK_BALANCE_API: ${{ vars.VITE_CHECK_BALANCE_API || 'https://chubgame.com/wp-json/chubgame/v1/check-balance' }} | |
VITE_MAX_DICE_AMOUNT: ${{ vars.VITE_MAX_DICE_AMOUNT || 10 }} | |
VITE_MIN_CHIPS_AMOUNT: ${{ vars.VITE_MIN_CHIPS_AMOUNT || 10 }} | |
VITE_MAX_CHIPS_AMOUNT: ${{ vars.VITE_MAX_CHIPS_AMOUNT || 100 }} | |
VITE_TURNSTILE_SITE_KEY: ${{ secrets.VITE_TURNSTILE_SITE_KEY }} | |
VITE_CHUBGAME_URL: ${{ vars.VITE_CHUBGAME_URL || 'https://chubgame.com' }} | |
VITE_OAUTH_CLIENT_ID: ${{ secrets.VITE_OAUTH_CLIENT_ID }} | |
VITE_OAUTH_CLIENT_SECRET: ${{ secrets.VITE_OAUTH_CLIENT_SECRET }} | |
run: npm run build | |
# Upload build artifacts to GitHub Pages | |
- name: Upload build artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: './dist' # Path to the build directory | |
# Deploy to GitHub Pages | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
# Optionally, set a custom status message if deployment succeeds | |
- name: Set deployment status | |
run: echo "Deployment successful" |