Skip to content

update Hugo action to newest version #67

update Hugo action to newest version

update Hugo action to newest version #67

Workflow file for this run

name: Hugo site CI
on:
push:
branches:
- master
- preview
pull_request:
branches:
- master
- preview
jobs:
build_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
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@v3
with:
hugo-version: '0.119.0'
- uses: Wohlstand/branch-name@v1.0.2-wohl
- name: Build site
run: chmod +x ci-build.sh && ./ci-build.sh ${{ github.sha }} ${{ github.run_id }} ${{ env.BRANCH_NAME }}
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: build
path: build
deploy:
runs-on: ubuntu-latest
needs: build_job
steps:
- uses: actions/download-artifact@v1
with:
name: build
- name: "Prepare SSH key and known hosts"
# https://github.com/symfony/cli/issues/227#issuecomment-601680974
run: |
mkdir -p ~/.ssh
echo "${{ secrets.KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan ${{ secrets.HOST }} >> ~/.ssh/known_hosts
- uses: Wohlstand/branch-name@v1.0.2-wohl
- name: Run deploy script
run: |
rsync -rSlh --stats build/ ${{ secrets.USERNAME }}@${{ secrets.HOST }}:${{ secrets.WEBPATH }}-${{ env.BRANCH_NAME }}/tar
ssh -o StrictHostKeyChecking=yes ${{ secrets.USERNAME }}@${{ secrets.HOST }} 'bash -s' -- < build/ci-deploy.sh ${{ secrets.WEBPATH }}-${{ env.BRANCH_NAME }}