add blackbox unit, pid sum #24
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: build | |
on: | |
push: | |
branches: | |
- "master" | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: cache cargo | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/ | |
key: ${{ runner.os }}-cargo | |
- name: install cargo packages | |
run: | | |
cargo install wasm-pack rsw | |
- name: cache node_modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node_modules | |
- name: install npm packages | |
run: npm install | |
- name: build gh-pages | |
run: | | |
npm run build:gh-pages | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gh-pages | |
path: docs | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: checkout gh-pages | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git pull | |
git checkout gh-pages | |
- uses: actions/download-artifact@v3 | |
with: | |
name: gh-pages | |
- name: update gh-pages | |
run: | | |
git add . | |
git commit -m "GitHub Pages $GITHUB_SHA" || exit 0 | |
git remote set-url --push origin https://actions:$GITHUB_TOKEN@github.com/BossHobby/Blackbox-Analyzer | |
git push -f |