Add config for Github Actions and Hugo deploy #5
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 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_extended_${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: | | |
touch ~/.awsrc | |
echo "AWS_ACCESS_KEY_ID=${{secrets.AWS_ACCESS_KEY_ID}}" >> ~/.awsrc | |
echo "AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}}" >> ~/.awsrc | |
source ~/.awsrc | |
hugo deploy |