.github/workflows/ci.yml
name: ci
on: [push]
jobs:
workload:
runs-on: ubuntu-latest
steps:
- name: Begin CI...
uses: actions/checkout@v2
- name: Use Node 12
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Use cached node_modules
uses: actions/cache@v1
with:
path: node_modules
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
nodeModules-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Bootstrap
run: yarn bootstrap
- name: Test
run: yarn test
- name: Build
if: github.ref == 'refs/heads/master'
run: yarn build
- name: Deploy web
if: github.ref == 'refs/heads/master'
run: |
git remote set-url origin https://git:${{ secrets.DEPLOY_GITHUB_TOKEN }}@github.com/sospedra/semantic-password-generator.git
yarn deploy:web
- name: Clean web
if: github.ref == 'refs/heads/master'
run: |
git checkout packages/website
git clean -df packages/website
- name: Deploy npm
if: github.ref == 'refs/heads/master'
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc && yarn deploy:npm
- name: Clean npm
if: github.ref == 'refs/heads/master'
run: |
git checkout packages/spg
git clean -df packages/spg
- name: Deploy extension
if: github.ref == 'refs/heads/master'
run: yarn deploy:extension
env:
CI: true
EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}