Merge pull request #103 from katzenpost/new_version_docsy_hugo #86
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 Hugo site to Pages | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
defaults: | ||
run: | ||
shell: bash | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
HUGO_VERSION: 0.139.3 | ||
outputs: | ||
page_url: ${{ steps.export_page_url.outputs.page_url }} | ||
steps: | ||
- name: Install Hugo | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: ${{ env.HUGO_VERSION }} | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .nvmrc | ||
cache: npm | ||
cache-dependency-path: package.json | ||
- name: Install PostCSS | ||
run: npm install autoprefixer postcss postcss-cli | ||
- name: Build with Hugo | ||
env: | ||
HUGO_ENVIRONMENT: production | ||
HUGO_ENV: production | ||
run: | | ||
hugo \ | ||
--gc \ | ||
--baseURL "https://katzenpost.network/" | ||
- name: Setup Pages | ||
id: pages | ||
uses: actions/configure-pages@v5 | ||
- name: Export Page URL | ||
id: export_page_url | ||
run: echo "page_url=${{ steps.pages.outputs.page_url }}" >> $GITHUB_ENV | ||
outputs: | ||
page_url: ${{ steps.pages.outputs.page_url }} | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./public | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ needs.build.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |