fix new gh-pages action #9
This file contains hidden or 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: | |
| - master | |
| name: Publish Docs | |
| jobs: | |
| publish_docs: | |
| if: github.repository == 'KWARC/rust-libxml' | |
| name: Publish Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: install dependencies | |
| uses: ryankurte/[email protected] | |
| with: | |
| packages: "libxml2-dev" | |
| - name: Set up LIBXML2 env var if compiling with the default bindings | |
| run: echo "LIBXML2=$(pkg-config libxml-2.0 --variable=libdir)/libxml2.so" >> "$GITHUB_ENV" | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| toolchain: stable | |
| override: true | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Build Documentation | |
| uses: actions-rs/cargo@v1 | |
| with: | |
| command: doc | |
| args: --all --no-deps | |
| - name: Deploy Documentation | |
| env: | |
| PUBLISH_BRANCH: gh-pages | |
| PUBLISH_DIR: ./target/doc | |
| run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| git fetch origin ${PUBLISH_BRANCH} | |
| git checkout ${PUBLISH_BRANCH} | |
| find "${GITHUB_WORKSPACE}/${PUBLISH_DIR}" -maxdepth 1 | tail -n +2 | xargs -I % cp -rf % "." | |
| cd ${GITHUB_WORKSPACE} | |
| git add --all | |
| git commit --allow-empty -m "Automated deployment: $(date -u) ${GITHUB_SHA}" | |
| git push origin ${PUBLISH_BRANCH} |