Skip to content

Add config for Github Actions and Hugo deploy #8

Add config for Github Actions and Hugo deploy

Add config for Github Actions and Hugo deploy #8

name: Build and deploy on Deuxfleurs infra
on:
workflow_dispatch:
push:
branches: deploy-to-deuxfleurs
jobs:
build_and_publish:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.125.2
HUGO_ENV: production
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Build Hugo
run: |
hugo -b "${{secrets.BASE_URL}}"
- name: Deploy to Deuxfleurs
run: |
mkdir ~/.aws
touch ~/.aws/credentials
echo "AWS_ACCESS_KEY_ID=${{secrets.AWS_ACCESS_KEY_ID}}" >> ~/.awsr/credentials
echo "AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}}" >> ~/.aws/credentials
echo "AWS_DEFAULT_REGION='garage'" >> ~/.aws/credentials
source ~/.aws/credentials
hugo deploy