Build Documentation #11
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: Build Documentation | |
on: workflow_dispatch | |
jobs: | |
build-docs: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: read | |
deployments: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to GH Packages | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull builder image | |
run: docker pull ghcr.io/norvica/docs:v0.3.0 | |
- name: Build Documentation | |
run: | | |
docker run --rm -v $(pwd)/docs/content:/app/content -v $(pwd)/docs/config/_default:/app/config/_default -v $(pwd)/docs/public:/app/public -e HUGO_ENVIRONMENT=production -e HUGO_ENV=production ghcr.io/norvica/docs:v0.3.0 npm run build -- --gc --minify --baseURL "https://validation.norvica.dev" | |
- name: Publish | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }} | |
directory: $(pwd)/docs/public |