fix hugo.yml #56
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 Hugo site to Pages | |
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 1 * *' | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| HUGO_VERSION: 0.124.1 | |
| steps: | |
| - name: Install Hugo CLI | |
| run: | | |
| wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ | |
| && sudo dpkg -i ${{ runner.temp }}/hugo.deb | |
| - name: Install Dart Sass | |
| run: sudo snap install dart-sass | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' # Specify the Python version you need | |
| - name: Install python dependencies | |
| run: | | |
| pip install bibtexparser | |
| pip install requests | |
| - name: Run orcid.py script | |
| run: python orcid.py | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@v5 | |
| - name: Install Node.js dependencies | |
| run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" | |
| - name: Build with Hugo | |
| env: | |
| HUGO_ENVIRONMENT: production | |
| HUGO_ENV: production | |
| run: | | |
| hugo \ | |
| --minify \ | |
| --baseURL "https://gtonkinhill.github.io/" | |
| - name: Verify public directory | |
| run: ls -lah public/ | |
| - name: Create CNAME file | |
| run: echo "gthlab.au" > public/CNAME | |
| - name: Disable Jekyll on GitHub Pages | |
| run: touch public/.nojekyll | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./public | |
| - name: Checkout the gtonkinhill.github.io repository | |
| uses: actions/checkout@v2 | |
| with: | |
| repository: gtonkinhill/gtonkinhill.github.io | |
| token: ${{ secrets.DEPLOY_KEY }} | |
| path: 'gtonkinhill.github.io' | |
| - name: Copy files | |
| run: | | |
| cp -a public/. gtonkinhill.github.io/ | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| personal_token: ${{ secrets.DEPLOY_KEY }} # Use the GitHub Token here | |
| publish_dir: ./gtonkinhill.github.io | |
| external_repository: gtonkinhill/gtonkinhill.github.io | |
| user_name: 'GitHub Actions' | |
| user_email: 'github-actions@users.noreply.github.com' | |
| commit_message: 'Deploy Hugo site update' |