Upgrade to latest #8
Workflow file for this run
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 staging | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, reopened, synchronize, ready_for_review] | |
workflow_dispatch: | |
env: | |
COMMIT_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
BRANCH: ${{ github.event_name == 'pull_request' && format('refs/heads/{0}', github.event.pull_request.head.ref) || github.ref }} | |
jobs: | |
build: | |
environment: staging | |
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 |