ci(test): merge files #57
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: Run E2E tests on new code in master, push if green | |
'on': | |
push: | |
branches: | |
- master | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-20.04 | |
container: | |
image: cypress/browsers:node18.12.0-chrome107 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '19' | |
cache: 'pnpm' | |
- run: pnpm install | |
- name: Cypress run | |
uses: cypress-io/github-action@v6 | |
with: | |
browser: chrome | |
start: npm run serve | |
wait-on: 'http://127.0.0.1:4321' | |
wait-on-timeout: 360 | |
- name: Upload E2E run data as artifacts | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: e2e-run-data | |
path: | | |
/home/runner/work/forgingmodernity.com/forgingmodernity.com/cypress/screenshots/* | |
/home/runner/work/forgingmodernity.com/forgingmodernity.com/cypress/videos/* | |
retention-days: 14 | |
deploy: | |
needs: cypress-run | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.REPO_GITHUB_TOKEN }} | |
branch: cloudflare | |
force: true |