Merge pull request #263 from PoliNetworkOrg/dependabot/npm_and_yarn/v… #446
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: CD | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
- main | |
jobs: | |
cd: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: [18] | |
steps: | |
- name: 🛎 Checkout | |
uses: actions/checkout@master | |
- name: 🏗 Setup node env | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ matrix.node }} | |
check-latest: true | |
- name: 📦 Cache node_modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: 👨🏻💻 Install dependencies (1) | |
run: yarn cache clean | |
- name: 👨🏻💻 Install dependencies (2) | |
run: | | |
(yarn) || true | |
(yarn install) || true | |
(yarn upgrade) || true | |
- name: commit | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Github action" | |
git add . | |
(git commit -m 'push files') || true | |
(git pull) || true | |
(git push) || true | |
- name: 👨🏭️ Generate | |
run: npm run generate | |
- name: 🚀 Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist |