82 editor de peñas para owners #53
Workflow file for this run
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
name: Deploy PR | |
on: | |
pull_request: | |
branches: | |
- main | |
env: | |
APP_URL: https://staging-peñas.montemayordepililla.cc/ | |
AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN_STAGING }} | |
AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID_STAGING }} | |
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET_STAGING }} | |
AUTH0_REDIRECT_URI: https://xn--staging-peas-jhb.montemayordepililla.cc/login/callback | |
DATABASE_URL: file:./dev.db | |
JWK: ${{ secrets.JWK }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
name: Deploy | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create .env file | |
uses: CallePuzzle/[email protected] | |
with: | |
variableNames: DATABASE_URL,AUTH0_DOMAIN,AUTH0_CLIENT_ID,AUTH0_CLIENT_SECRET,JWK | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: yarn install --pure-lockfile | |
- name: Data for tests | |
run: npx wrangler d1 migrations apply donde-esta-tu-local --local && npx prisma db seed | |
- name: Tests | |
run: yarn test:unit | |
- name: D1 Migrations Apply | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN_STAGING }} | |
wranglerVersion: 3.74.0 | |
command: d1 migrations apply donde-esta-tu-local-staging --remote --env staging | |
- name: Deploy | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN_STAGING }} | |
wranglerVersion: 3.74.0 | |
command: deploy --env staging |