feat(docs): add docs and github actions #127
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
on: | |
push: | |
branches: | |
- main | |
name: Update schema | |
jobs: | |
update_schema: | |
runs-on: ubuntu-latest | |
steps: | |
- name: clone schema | |
run: | | |
cd /tmp/ | |
git clone https://${{ secrets.API_TOKEN_GITHUB }}@github.com/rabbit-digger/schema | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Cache Cargo | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo | |
key: ${{ matrix.os }}-stable-cargo-v1 | |
restore-keys: | | |
${{ matrix.os }}-stable-cargo-v1 | |
- name: Setup toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- name: Generate schema | |
uses: actions-rs/cargo@v1 | |
with: | |
command: run | |
args: -- generate-schema /tmp/rabbit-digger-pro-schema.json | |
- name: Update git repo | |
run: | | |
cd /tmp/schema/ | |
cp /tmp/rabbit-digger-pro-schema.json . | |
git add . | |
git config user.email "spacemeowx2@gmail.com" | |
git config user.name "spacemeowx2" | |
git commit -m "update at `date`" && git push || true |