Deploy documentation #12
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
| name: Deploy documentation | |
| on: | |
| workflow_run: | |
| workflows: ["Release"] | |
| types: | |
| - completed | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "docs" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@v5 | |
| - name: Build and extract | |
| run: | | |
| docker build \ | |
| -f docs/Dockerfile \ | |
| --build-arg CONTAINER_ENV=production \ | |
| --build-arg SITE_URL="${{ steps.pages.outputs.origin }}" \ | |
| --build-arg BASE_PREFIX="${{ steps.pages.outputs.base_path }}" \ | |
| --tag docs . | |
| mkdir -p docs/dist | |
| CONTAINER_ID=$(docker create docs) | |
| docker cp $CONTAINER_ID:/app/dist/. docs/dist/ | |
| docker rm -v $CONTAINER_ID | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/dist | |
| deploy: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |