Skip to content

Commit

Permalink
update github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlivio committed Oct 3, 2023
1 parent 22e9689 commit 7bcc872
Showing 1 changed file with 49 additions and 14 deletions.
63 changes: 49 additions & 14 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ on:
paths:
- "latex/*"
- "shared/*"
- "docs/*"
- "docusaurus.config.js"
- "content/*"
- "config/*"

permissions:
contents: write
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
gh-pages:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.115.4
steps:
- uses: actions/checkout@v3
- uses: xu-cheng/texlive-action/full@v1
Expand All @@ -28,16 +36,43 @@ jobs:
- name: cp pdfs to static/
run:
cp latex/cv.pdf latex/certificates.pdf static/
- uses: actions/setup-node@v3
- 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@v3
with:
node-version: 18
cache: npm
- name: Install dependencies
run: npm install --frozen-lockfile
- name: Build website
run: npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: update content/publication
run: scripts/update_publication.sh
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build # Build output to publish to the `gh-pages` branch
path: ./public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 7bcc872

Please sign in to comment.