mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-02-23 15:19:00 +00:00
Build with Netlify
Mainly because of `baseURL` issues, I cannot deploy this site properly with its assets. To fix it, I just have to properly set them and the easiest way to do so is to build it with Netlify. With this change, the webring post update will be in a separate workflow and done in a schedule.
This commit is contained in:
parent
20c452e657
commit
a1f65a29a9
30
.github/workflows/build.yml
vendored
30
.github/workflows/build.yml
vendored
@ -1,30 +0,0 @@
|
|||||||
name: "Build and deploy to Netlify"
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: cachix/install-nix-action@v17
|
|
||||||
with:
|
|
||||||
nix_path: nixpkgs=channel:nixpkgs-unstable
|
|
||||||
- run: nix develop -c make build
|
|
||||||
- name: Deploy to Netlify
|
|
||||||
uses: nwtgck/actions-netlify@v1.2
|
|
||||||
with:
|
|
||||||
publish-dir: ./public
|
|
||||||
netlify-config-path: ./netlify.toml
|
|
||||||
production-branch: master
|
|
||||||
production-deploy: ${{ github.ref_name == 'master' }}
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
deploy-message: "Deploy from GitHub Actions"
|
|
||||||
enable-pull-request-comment: true
|
|
||||||
enable-commit-comment: true
|
|
||||||
enable-commit-status: true
|
|
||||||
overwrites-pull-request-comment: false
|
|
||||||
env:
|
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN }}
|
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
|
27
.github/workflows/update-webring.yml
vendored
Normal file
27
.github/workflows/update-webring.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
name: "Update webring post list"
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# Every Sunday.
|
||||||
|
- cron: '0 0 * * 0'
|
||||||
|
env:
|
||||||
|
# GitHub bot
|
||||||
|
GIT_AUTHOR_NAME: "github-actions[bot]"
|
||||||
|
GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
|
||||||
|
jobs:
|
||||||
|
update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: cachix/install-nix-action@v18
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
extra_nix_config: |
|
||||||
|
keep-going = true
|
||||||
|
- run: nix develop -c make build-openring
|
||||||
|
- name: Update webring post list
|
||||||
|
run: |
|
||||||
|
git add .
|
||||||
|
git commit -m "Update webring post list as of $(date '+%F')"
|
||||||
|
git remote remove origin
|
||||||
|
git remote add origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||||
|
git push --set-upstream origin master
|
14
netlify.toml
14
netlify.toml
@ -1,15 +1,19 @@
|
|||||||
[build]
|
[build]
|
||||||
publish = "public/"
|
publish = "public/"
|
||||||
command = "make build"
|
command = "hugo --gc --minify"
|
||||||
|
|
||||||
[context.production.environment]
|
[context.production.environment]
|
||||||
|
HUGO_VERSION = "0.107.0"
|
||||||
|
HUGO_ENV = "production"
|
||||||
|
HUGO_ENABLEGITINFO = "true"
|
||||||
HUGO_BASE_URL = "$DEPLOY_URL"
|
HUGO_BASE_URL = "$DEPLOY_URL"
|
||||||
|
|
||||||
[context.branch-deploy.environment]
|
[context.branch-deploy.environment]
|
||||||
|
HUGO_VERSION = "0.107.0"
|
||||||
HUGO_BASE_URL = "$DEPLOY_PRIME_URL"
|
HUGO_BASE_URL = "$DEPLOY_PRIME_URL"
|
||||||
|
|
||||||
[context.deploy-preview]
|
|
||||||
command = "hugo --buildDrafts --buildFuture --buildExpired"
|
|
||||||
|
|
||||||
[context.deploy-preview.environment]
|
[context.deploy-preview.environment]
|
||||||
HUGO_BASE_URL = "$DEPLOY_PRIME_URL"
|
HUGO_VERSION = "0.107.0"
|
||||||
|
|
||||||
|
[context.deploy-preview]
|
||||||
|
command = "hugo --buildDrafts --buildFuture --buildExpired --baseURL $DEPLOY_PRIME_URL"
|
||||||
|
Loading…
Reference in New Issue
Block a user