Refresh screenshots #34
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: Refresh screenshots | |
on: | |
schedule: | |
# Every 1st day of a month at 1am | |
- cron: '0 1 1 * *' | |
jobs: | |
remove-old-artifacts: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Nodejs | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
- name: Cache node modules | |
uses: actions/cache@v1 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install Dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Cypress run | |
uses: cypress-io/github-action@v2 | |
with: | |
record: true | |
start: npm run start:serve | |
wait-on: 'http://localhost:5000' | |
command-prefix: 'percy exec -- npx' | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} |