update action #2
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: Deploy MkDocs Site | |
on: | |
push: | |
branches: | |
- main # Trigger the workflow on push to main branch | |
paths: | |
- "docs/**" | |
- "mkdocs.yml" | |
- ".github/workflows/deploy-mkdocs.yml" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pages: write | |
env: | |
IMAGE: ghcr.io/rox-automation/roxbot:latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2j | |
- name: Log in to the Container registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull the Docker image | |
run: docker pull ${{ env.IMAGE }} | |
- name: Run MkDocs build | |
run: | | |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ${{ env.IMAGE }} mkdocs build -d /site | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./site |