From 8967e96db07188dcc66ee0b7ac1c5f7d74fa8b3d Mon Sep 17 00:00:00 2001 From: Tixie Date: Sun, 21 Apr 2024 22:31:35 +0200 Subject: [PATCH] Add config for Github Actions and Hugo deploy --- .github/workflows/deploy-deuxfleurs.yml | 35 +++++++++++++++++++++++++ config.toml | 8 ++++-- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy-deuxfleurs.yml diff --git a/.github/workflows/deploy-deuxfleurs.yml b/.github/workflows/deploy-deuxfleurs.yml new file mode 100644 index 0000000..2cf591c --- /dev/null +++ b/.github/workflows/deploy-deuxfleurs.yml @@ -0,0 +1,35 @@ +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: | + 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 diff --git a/config.toml b/config.toml index aca010f..68ed9df 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,4 @@ -baseURL = "http://localhost:1313/" +baseURL = "http://localhost:1312/" languageCode = "en-us" title = "Now Playing" mainSections = ["a"] @@ -17,4 +17,8 @@ disableKinds = ["taxonomy"] quality = 95 [security] [security.funcs] - getenv = [ "^HUGO_", "CONTEXT", "URL" ] + getenv = [ "^HUGO_", "CONTEXT", "URL", "BASE_URL" ] +## Deploy into a Garage bucket at Deuxfleurs +[[deployment.targets]] +name = "deuxfleurs" +URL = "s3://now-playing?endpoint=garage.deuxfleurs.fr®ion=garage&s3ForcePathStyle=true"