diff --git a/.github/workflows/deploy-to-prod.yml b/.github/workflows/deploy-to-prod.yml index e6b9f10..84fbe2b 100644 --- a/.github/workflows/deploy-to-prod.yml +++ b/.github/workflows/deploy-to-prod.yml @@ -32,8 +32,19 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + - name: Connect to Tailscale + uses: tailscale/github-action@v2 + with: + oauth-client-id: ${{ secrets.TS_API_CLIENT_ID }} + oauth-secret: ${{ secrets.TS_API_CLIENT_SECRET }} + tags: ${{ secrets.TS_TAG }} + - name: Configure SSH known hosts + run: | + mkdir -p ~/.ssh + echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts - name: Build with Hugo - run: hugo --minify + run: HUGO_REMOTE_FONT_PATH=${{ secrets.REMOTE_FONT_PATH }} hugo --minify - name: Insert 404 page run: | cp public/404/index.html public/not_found.html @@ -47,17 +58,6 @@ jobs: api_token: ${{ secrets.NEOCITIES_API_TOKEN }} cleanup: true dist_dir: public - - name: Connect to Tailscale - uses: tailscale/github-action@v2 - with: - oauth-client-id: ${{ secrets.TS_API_CLIENT_ID }} - oauth-secret: ${{ secrets.TS_API_CLIENT_SECRET }} - tags: ${{ secrets.TS_TAG }} - - name: Configure SSH known hosts - run: | - mkdir -p ~/.ssh - echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts - name: Deploy GMI to Agate run: | rsync -avz --delete --exclude='*.html' --exclude='*.css' --exclude='*.js' -e ssh public/ deploy@${{ secrets.GMI_HOST }}:${{ secrets.GMI_CONTENT_PATH }} diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html index 7bddaa1..9f7f463 100644 --- a/layouts/partials/opengraph.html +++ b/layouts/partials/opengraph.html @@ -1,6 +1,16 @@ {{ $img := resources.Get "og_base.png" }} -{{ $font := resources.Get "/FiraMono-Regular.ttf" }} {{ $text := "" }} +{{ $font := "" }} +{{ $path := os.Getenv "HUGO_REMOTE_FONT_PATH" }} +{{ with resources.GetRemote $path }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} + {{ $font = . }} + {{ end }} +{{ else }} + {{ errorf "Unable to get resource %q" $path }} +{{ end }}