Revert Netlify build to GitHub Actions

This commit is contained in:
Gabriel Arazas 2022-11-28 11:17:59 +08:00
parent 4890e7f0ee
commit 99112147e4
3 changed files with 35 additions and 46 deletions

30
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,30 @@
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 }}

View File

@ -1,27 +0,0 @@
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

View File

@ -1,29 +1,15 @@
[build]
publish = "public/"
command = "gem install bundler -v '~> 2.3' && bundle && hugo --gc --minify"
[context.production]
command = "gem install bundler -v '~> 2.3' && bundle && hugo --gc --minify --baseURL $URL"
command = "make build"
[context.production.environment]
RUBY_VERSION = "3.0.4"
HUGO_VERSION = "0.107.0"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.branch-deploy]
command = "gem install bundler -v '~> 2.3' && bundle && hugo --buildDrafts --buildFuture --buildExpired --baseURL $DEPLOY_PRIME_URL"
HUGO_BASE_URL = "$DEPLOY_URL"
[context.branch-deploy.environment]
RUBY_VERSION = "3.0.4"
HUGO_VERSION = "0.107.0"
HUGO_ENV = "development"
HUGO_BASE_URL = "$DEPLOY_PRIME_URL"
[context.deploy-preview]
command = "gem install bundler -v '~> 2.3' && bundle && hugo --buildDrafts --buildFuture --buildExpired --baseURL $DEPLOY_PRIME_URL"
command = "hugo --buildDrafts --buildFuture --buildExpired"
[context.deploy-preview.environment]
RUBY_VERSION = "3.0.4"
HUGO_ENV = "development"
HUGO_VERSION = "0.107.0"
HUGO_BASE_URL = "$DEPLOY_PRIME_URL"