Merge pull request #225 from PoliNetworkOrg/dependabot/npm_and_yarn/b… #270
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: [16] | |
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: npm cache verify | |
- name: 👨🏻💻 Install dependencies (2) | |
run: npm install | |
- 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 | |
(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 |