This repository has been archived by the owner on May 24, 2024. It is now read-only.
CI and CD #74
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: CI and CD | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
schedule: | |
- cron: '0 1 * * SUN' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
- name: Setup Project | |
uses: ./.github/actions/setup | |
- name: Linting Project | |
run: | | |
npm run lint | |
- name: Testing Project | |
run: | | |
npm run jest | |
release-and-deploy: | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v2 | |
- name: Setup GitHub Config | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
- name: Setup Project | |
uses: ./.github/actions/setup | |
- name: Build | |
run: npm run compile:prod | |
- name: Release | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npx terra release | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./lib | |
force_orphan: true | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
commit_message: 'chore(docs): Regenerate docs' |