Skip to content

Merge pull request #32 from dominicarrojado/dependabot/npm_and_yarn/f… #55

Merge pull request #32 from dominicarrojado/dependabot/npm_and_yarn/f…

Merge pull request #32 from dominicarrojado/dependabot/npm_and_yarn/f… #55

Workflow file for this run

name: CI/CD
on:
push:
branches: [develop]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache dependencies
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run the tests
run: yarn test -- --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
- name: Build
run: yarn build
- name: Deploy
run: |
git config --global user.name $user_name
git config --global user.email $user_email
git remote set-url origin https://${github_token}@github.com/${repository}
yarn deploy
env:
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }}
repository: ${{ github.repository }}
- name: Merge gh-pages -> main
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: gh-pages
target_branch: main
github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }}