build: try using other github action for hugo build #59
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: Publish Site | |
on: | |
push: | |
branches: | |
- docs | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Default to bash | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
HUGO_VERSION: 0.131.0 | |
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 | |
fetch-depth: 0 | |
- name: Generate pre-filtered CSV examples | |
run: | | |
mkdir -p static/examples | |
curl https://raw.githubusercontent.com/lowdit/frago/master/exampleSite/exampleFiles/grille-criteres-rgaa-4.csv --output grille-criteres-rgaa-4.csv | |
curl https://raw.githubusercontent.com/lowdit/frago/master/exampleSite/exampleFiles/grille-tests-rgaa-4.0.csv --output grille-tests-rgaa-4.0.csv | |
curl https://raw.githubusercontent.com/lowdit/frago/master/exampleSite/exampleFiles/grille-tests-rgaa-4.1.csv --output grille-tests-rgaa-4.1.csv | |
cat grille-criteres-rgaa-4.csv| grep -E '25|Thématique' > static/examples/grille-criteres-rgaa-4_25.csv | |
cat grille-criteres-rgaa-4.csv| grep -E '25|50|Thématique' > static/examples/grille-criteres-rgaa-4_50.csv | |
cat grille-criteres-rgaa-4.csv| grep -E '25|50|81|Thématique' > static/examples/grille-criteres-rgaa-4_81.csv | |
cat grille-criteres-rgaa-4.csv > static/examples/grille-criteres-rgaa-4_all.csv | |
cat grille-tests-rgaa-4.0.csv | grep -E '25|Thématique' > static/examples/grille-tests-rgaa-4.0_25.csv | |
cat grille-tests-rgaa-4.0.csv | grep -E '25|50|Thématique' > static/examples/grille-tests-rgaa-4.0_50.csv | |
cat grille-tests-rgaa-4.0.csv | grep -E '25|50|81|Thématique' > static/examples/grille-tests-rgaa-4.0_81.csv | |
cat grille-tests-rgaa-4.0.csv > static/examples/grille-tests-rgaa-4.0_all.csv | |
cat grille-tests-rgaa-4.1.csv | grep -E '25|50|81|Thématique' > static/examples/grille-tests-rgaa-4.1_81.csv | |
cat grille-tests-rgaa-4.1.csv | grep -E '25|50|Thématique' > static/examples/grille-tests-rgaa-4.1_50.csv | |
cat grille-tests-rgaa-4.1.csv | grep -E '25|Thématique' > static/examples/grille-tests-rgaa-4.1_25.csv | |
cat grille-tests-rgaa-4.1.csv > static/examples/grille-tests-rgaa-4.1_all.csv | |
rm -rf ./*.csv | |
- name: Build with Hugo | |
env: | |
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache | |
HUGO_ENVIRONMENT: production | |
TZ: Europe/Paris | |
run: | | |
hugo \ | |
--gc \ | |
--minify \ | |
--cleanDestinationDir \ | |
--baseURL "${{ steps.pages.outputs.base_url }}/" | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./public | |
# Deployment job | |
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@v4 | |