update build-and-deploy pipeline with explicit dependency versions
Some checks failed
Build and Deploy Hugo Site / buildAndDeploy (push) Failing after 15s

This commit is contained in:
Andreas Hnida 2024-04-18 21:57:57 +02:00
commit b6c7c07c49

View file

@ -5,6 +5,11 @@ on:
branches: branches:
- main - main
env:
HUGO_VERSION: '0.121.2'
GO_VERSION: '1.20.5'
NODE_VERSION: '20.0.0'
jobs: jobs:
buildAndDeploy: buildAndDeploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -21,10 +26,13 @@ jobs:
- name: Echo environment - name: Echo environment
run: echo "Environment is ${{ steps.read_toml.outputs.value }}" run: echo "Environment is ${{ steps.read_toml.outputs.value }}"
- name: Set up Go - name: Install Go
uses: actions/setup-go@v5.0.0 run: |
with: curl -LO "https://dl.google.com/go/go${{ env.GO_VERSION }}.linux-amd64.tar.gz"
go-version: '1.20.5' sudo tar -C /usr/local -xzf go${{ env.GO_VERSION }}.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> $GITHUB_ENV
rm go${{ env.GO_VERSION }}.linux-amd64.tar.gz
go version
- name: Cache Go modules - name: Cache Go modules
uses: actions/cache@v3 uses: actions/cache@v3
@ -40,6 +48,9 @@ jobs:
node-version: '20' node-version: '20'
cache: 'npm' cache: 'npm'
- name: Install npm dependencies
run: npm install
- name: Cache Node modules - name: Cache Node modules
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@ -48,16 +59,16 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-node- ${{ runner.os }}-node-
- name: Install PostCSS - name: Install Hugo
run: | run: |
npm install -g postcss postcss-cli curl -LO "https://github.com/gohugoio/hugo/releases/download/v${{ env.HUGO_VERSION }}/hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz"
npm install autoprefixer tar -xvf hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz
sudo mv hugo /usr/local/bin/
rm hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz
hugo version
- name: Set up Hugo Extended - name: Setup Project
uses: peaceiris/actions-hugo@v3.0.0 run: npm run project-setup
with:
hugo-version: '0.121.2'
extended: true
- name: Build Hugo site - name: Build Hugo site
run: hugo --minify run: hugo --minify