fix #29
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 | |
on: | |
pull_request: | |
push: | |
workflow_call: | |
inputs: | |
environment: | |
required: false | |
type: string | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
environment: ${{ inputs.environment }} | |
steps: | |
- run: printenv SSH_HOST || true # TODO remove | |
env: | |
SSH_HOST: ${{ vars.SSH_HOST }} | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ">=1.21.1" | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
cache: npm | |
node-version: "20.6.1" | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
extended: true | |
hugo-version: "0.118.2" | |
- name: Install Dependencies | |
run: npm i # TODO fix vulnerabilities | |
- name: Build | |
env: | |
HUGO_ENV: ${{ inputs.environment }} | |
run: hugo --minify | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: html | |
path: public | |
if-no-files-found: error |