add manifest to a mobile browser #150
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
on: | |
pull_request: | |
branches: | |
- master | |
name: pullrequest | |
jobs: | |
pullrequest: | |
name: Test & Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.17 | |
- name: Cache node_modules | |
id: cache-modules | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: 18.17.x-${{ runner.OS }}-build-${{ hashFiles('package.json') }} | |
- name: NPM Install | |
if: steps.cache-modules.outputs.cache-hit != 'true' | |
run: npm install | |
- name: Lint | |
run: npm run-script lint | |
- name: Pretty | |
run: npm run-script prettier-check | |
- name: Local Test | |
run: npm test | |
- name: Build | |
run: npm run build | |
DeployExamples: | |
name: DeployExamples | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: true | |
matrix: | |
example: [reactjs, reactts, vanillajs, vitereactts, nextts, nuxt3] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.17 | |
- name: Cache node_modules | |
id: cache-modules | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: 18.17.x-${{ runner.OS }}-build-${{ hashFiles('package.json') }} | |
- name: NPM Install | |
if: steps.cache-modules.outputs.cache-hit != 'true' | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Install example dependencies | |
if: ${{matrix.example != 'vanillajs'}} | |
working-directory: examples/${{matrix.example}} | |
run: npm install | |
- name: Deploy example | |
working-directory: examples/${{matrix.example}} | |
run: | | |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
npm run deploy | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
Cypress: | |
name: Cypress | |
needs: DeployExamples | |
runs-on: ubuntu-latest | |
container: cypress/browsers:node12.18.3-chrome87-ff82 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cypress run | |
uses: cypress-io/github-action@v4 | |
with: | |
browser: chrome | |
record: true | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
# pass GitHub token to allow accurately detecting a build vs a re-run build | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} |