Merge pull request #66 from ethereumfollowprotocol/leaderboard-and-slots #356
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 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| development: | |
| type: boolean | |
| description: 'Deploy to development environment' | |
| required: false | |
| default: true | |
| production: | |
| type: boolean | |
| description: 'Deploy to production environment' | |
| required: false | |
| default: true | |
| stage: | |
| type: boolean | |
| description: 'Deploy to stage environment' | |
| required: false | |
| default: false | |
| test: | |
| type: boolean | |
| description: 'Deploy to test environment' | |
| required: false | |
| default: false | |
| all: | |
| type: boolean | |
| description: 'Deploy to all environments' | |
| required: false | |
| default: false | |
| push: | |
| branches: [develop] | |
| concurrency: | |
| group: deploy-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| ACTIONS_RUNNER_DEBUG: true | |
| NODE_OPTIONS: '--no-warnings' | |
| jobs: | |
| checks: | |
| uses: './.github/workflows/checks.yml' | |
| deploy-workers: | |
| if: ${{ !contains(github.event.head_commit.message, '[skip-deploy]') }} | |
| needs: [checks] | |
| timeout-minutes: 3 | |
| runs-on: ['ubuntu-latest'] | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| # Supabase database url | |
| DEVELOPMENT_DATABASE: ${{ secrets.DATABASE_URL }} | |
| PRODUCTION_DATABASE: null | |
| steps: | |
| - name: '🔑 Checkout' | |
| uses: actions/checkout@v4.1.1 | |
| - name: '🐰 Setup Bun' | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: 'latest' | |
| - name: 'Install Dependencies' | |
| run: bun install | |
| - name: 'Get Commit SHA' | |
| id: get_commit_sha | |
| run: echo "COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
| # https://developers.cloudflare.com/workers/wrangler/commands/#deploy | |
| - name: '[development] Deploy Cloudflare Workers 🔶' | |
| uses: ethereumfollowprotocol/actions/.github/actions/deploy-cloudflare-worker@main | |
| with: | |
| env: "development" | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| vars: '{"COMMIT_SHA": "${{ steps.get_commit_sha.outputs.COMMIT_SHA }}"}' | |
| # https://developers.cloudflare.com/workers/wrangler/commands/#deploy | |
| - name: '[production] Deploy Cloudflare Workers 🔶' | |
| uses: ethereumfollowprotocol/actions/.github/actions/deploy-cloudflare-worker@main | |
| with: | |
| env: "production" | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| vars: '{"COMMIT_SHA": "${{ steps.get_commit_sha.outputs.COMMIT_SHA }}"}' |