Skip to content

Commit

Permalink
Add config for Github Actions and Hugo deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
TixieSalander committed Apr 21, 2024
1 parent 6fa0de6 commit 063e54a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy-deuxfleurs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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 "${{secrets.AWS_ACCESS_KEY_ID}}" >> ~/.aws/credentials
echo "${{secrets.AWS_SECRET_ACCESS_KEY}}" >> ~/.aws/credentials
ls -l ~/.aws/credentials
8 changes: 6 additions & 2 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
baseURL = "http://localhost:1313/"
baseURL = "http://localhost:1312/"
languageCode = "en-us"
title = "Now Playing"
mainSections = ["a"]
Expand All @@ -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&region=garage&s3ForcePathStyle=true"
7 changes: 6 additions & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@
{{ end }}
{{ end }}

{{ $opts := dict
"transpiler" "dartsass"
"vars" site.Params.styles
"enableSourceMap" (not hugo.IsProduction)
}}
{{ $sass := resources.Get "/scss/style.scss" }}
{{ $style := $sass | resources.ToCSS | minify | fingerprint }}
{{ $style := $sass | resources.ToCSS $opts | minify | fingerprint }}
{{ $secureStyle := $style | resources.Fingerprint "sha512" }}
<link rel="preload" href="{{ $secureStyle.Permalink }}" as="style" />
<link rel="stylesheet" href="{{ $secureStyle.Permalink }}" integrity="{{ $secureStyle.Data.Integrity }}">
Expand Down

0 comments on commit 063e54a

Please sign in to comment.