refactor: switch to Java records fro configuration #6
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 && deploy to Github Pages | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
deploy: | |
environment: production | |
runs-on: ubuntu-latest | |
env: | |
NODE_ENV: ${{ vars.NODE_ENV}} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true # Fetch Hugo themes (true OR recursive) | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: ${{ vars.HUGO_VERSION }} | |
extended: true | |
env: | |
HUGO_GOOGLEANALYTICS: ${{ secrets.HUGO_GOOGLE}} | |
HUGOxPARAMSxALGOLIA_APPID: ${{ secrets.HUGOXPARAMSXALGOLIA_APPID }} | |
HUGOxPARAMSxALGOLIA_APIKEY: ${{ secrets.HUGOXPARAMSXALGOLIA_APIKEY }} | |
HUGOxPARAMSxALGOLIA_INDEXNAME: ${{ secrets.HUGOXPARAMSXALGOLIA_INDEXNAME }} | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ vars.RUBY_VERSION }} | |
- run: gem install asciidoctor asciidoctor-html5s asciidoctor-rouge | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ vars.NODE_VERSION }} | |
- run: npm install | |
- name: Run Hugo | |
run: | | |
hugo ${{ vars.HUGO_ARGS }} | |
cd scripts/ | |
./sw.sh | |
- name: Upload Hugo Algolia Index | |
uses: aoudiamoncef/hugo-algolia-uploader@main | |
with: | |
app_id: ${{ secrets.HUGOXPARAMSXALGOLIA_APPID }} | |
admin_key: ${{ secrets.HUGO_ALGOLIA_ADMIN_APIKEY }} | |
index_name: ${{ secrets.HUGOXPARAMSXALGOLIA_INDEXNAME }} | |
index_languages: en,fr | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |