[GITHUB] changeing how docs are deployed #3
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: Ygen rust workflow | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check | |
run: cargo check --all | |
- name: Run tests | |
run: cargo test --all | |
- name: Build docs | |
- run: cargo doc --no-deps | |
- name: Deploy docs to doc branch | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git clone --branch=doc https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git doc | |
rsync -av target/doc/ doc/ | |
cd doc | |
git add --all | |
git commit -m 'Update documentation' | |
git push origin doc |