Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor workflows #272

Merged
merged 10 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

version: 2
updates:
# Update the git submodules
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
- "automerge"

# Update the Github Action versions
- package-ecosystem: "github-actions"
directory: "/"
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/html-proof.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/lighthouse-check.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/md-link-check.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to Github Pages
name: Merge to main workflows

# run when a commit is pushed to "source" branch
on:
Expand All @@ -7,7 +7,7 @@ on:
- main

jobs:
deploy:
deploy-to-gh-pages:
runs-on: ubuntu-latest
steps:
# checkout to the commit that has been pushed
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: PR Workflows

# Run action on pull request event
on: [pull_request]


jobs:
# Build exampleSite
build:
runs-on: ubuntu-latest
steps:
# checkout to the commit that has been pushed
- uses: actions/[email protected]

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install node modules
run: npm install

- name: Setup Hugo
uses: peaceiris/[email protected]
with:
hugo-version: 'latest'
extended: true

- name: Build
run: |
hugo --minify


lighthouse-check:
runs-on: ubuntu-latest
steps:
- name: Waiting for Netlify Preview
uses: kamranayub/[email protected]
id: preview
with:
site_name: "toha"
max_timeout: 300
env:
NETLIFY_TOKEN: ${{secrets.NETLIFY_TOKEN}}

- name: Run Lighthouse
uses: foo-software/[email protected]
id: lighthouseCheck
with:
accessToken: ${{ secrets.LIGHTHOUSE_TOKEN }}
gitHubAccessToken: ${{secrets.GITHUB_TOKEN}}
emulatedFormFactor: 'all'
prCommentEnabled: true
prCommentSaveOld: false
timeout: 5
urls: "${{ steps.preview.outputs.url }},${{ steps.preview.outputs.url }}/posts/,${{ steps.preview.outputs.url }}/posts/markdown-sample/,${{ steps.preview.outputs.url }}/posts/shortcodes/"

# Check for any broken links
markdown-link-check:
runs-on: ubuntu-latest
steps:
# checkout to latest commit
- uses: actions/checkout@master

- name: Waiting for Netlify Preview
uses: kamranayub/[email protected]
id: preview
with:
site_name: "toha"
max_timeout: 300
env:
NETLIFY_TOKEN: ${{secrets.NETLIFY_TOKEN}}

- name: Link Checker
id: lychee
uses: lycheeverse/[email protected]
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
args: "--verbose --exclude-mail ${{steps.preview.outputs.url}} --exclude=['https://www.udemy.com/']"
output: lychee/out.md

- name: Comment Broken Links
if: ${{ steps.lychee.outputs.exit_code != 0 }}
uses: marocchino/sticky-pull-request-comment@v2
with:
path: lychee/out.md

- name: Fail workflow if broken links found
if: ${{ steps.lychee.outputs.exit_code != 0 }}
run: exit 1
52 changes: 52 additions & 0 deletions .github/workflows/theme-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Theme Update"

on:
schedule:
- cron: "0 0 * * *"

jobs:
update-theme:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
ref: main

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Setup Hugo
uses: peaceiris/[email protected]
with:
hugo-version: "latest"
extended: true

- name: Update hugo modules
run: |
# update to latest version of all modules
hugo mod get -u

# update the npm dependencies
hugo mod npm pack

# cleanup go.sum file
hugo mod tidy

- name: Install node modules
run: npm install

- name: Build
run: |
# build the site
hugo --minify
# remove file generated by the build
rm -rf public/

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
base: main
title: Update theme
labels: automerge
2 changes: 1 addition & 1 deletion assets/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"baseUrl": ".",
"paths": {
"*": [
"../../toha/assets/*"
"../../../../../.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugo-toha/toha/[email protected]/assets/*"
]
}
}
Expand Down
6 changes: 3 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ params:
# Show/hide newsletter section in the footer. Default is "true".
# Currently, it supports "mailchimp".
newsletter:
enable: true
provider: mailchimp
mailchimpURL: https://github.us1.list-manage.com/subscribe/post?u=19de52a4603135aae97163fd8&id=094a24c76e
enable: false
# provider: mailchimp
# mailchimpURL: https://github.us1.list-manage.com/subscribe/post?u=19de52a4603135aae97163fd8&id=094a24c76e

# Show/hide disclaimer notice in the footer. Default is "false".
disclaimer:
Expand Down
16 changes: 0 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
github.com/hugo-toha/toha/v4 v4.0.0-20230928222719-6dc9d1d33db8 h1:9EEY0tMgzf0NEKRYdtc+WwrG6FMolQuQIPujzdh3++M=
github.com/hugo-toha/toha/v4 v4.0.0-20230928222719-6dc9d1d33db8/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ=
github.com/hugo-toha/toha/v4 v4.0.0-20230929230448-5f0aebcf6842 h1:WXIgg+D6DzPuahhVBoL4ytm/+mgyxAjnDSv24jzmQAY=
github.com/hugo-toha/toha/v4 v4.0.0-20230929230448-5f0aebcf6842/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ=
github.com/hugo-toha/toha/v4 v4.0.0-20230929231747-c943f39617c1 h1:iPPEerrlIaBH5TvkQSQ71Rg09C5GvGVodM0WOiipUcc=
github.com/hugo-toha/toha/v4 v4.0.0-20230929231747-c943f39617c1/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ=
github.com/hugo-toha/toha/v4 v4.0.0-20231006193257-e8f8f3b22b76 h1:tdFPiwCPgQvOR/4CINRu8MRFfV8dg4wJtdRL8ky3Iz8=
github.com/hugo-toha/toha/v4 v4.0.0-20231006193257-e8f8f3b22b76/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ=
github.com/hugo-toha/toha/v4 v4.0.0-20231020202026-69611695e7e3 h1:SOiejz6dJw2jm+MBDKrznDKVWpPPXMe2YUqin9BY6Ek=
github.com/hugo-toha/toha/v4 v4.0.0-20231020202026-69611695e7e3/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ=
github.com/hugo-toha/toha/v4 v4.0.0-20231031071528-05c9d3d850b2 h1:EkR94Ztv1Ao+iEP0e5Vk/GRmZvhAjSHzjsMOXBaK3Ak=
github.com/hugo-toha/toha/v4 v4.0.0-20231031071528-05c9d3d850b2/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ=
github.com/hugo-toha/toha/v4 v4.0.0-20231031082454-cd2546d4e8ea h1:CCJ4JjZFHNWx8jLG8BQDx6Yf6pLbXY09LKgJdcUI3zc=
github.com/hugo-toha/toha/v4 v4.0.0-20231031082454-cd2546d4e8ea/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ=
github.com/hugo-toha/toha/v4 v4.0.0-20231206184850-bb9fec2e5d53 h1:sKr2HLVq1b3aFsgiXDUTneqBNnsakm0xCnxrqEFi/Oo=
github.com/hugo-toha/toha/v4 v4.0.0-20231206184850-bb9fec2e5d53/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ=
github.com/hugo-toha/toha/v4 v4.0.0 h1:rOiQeXzppzBLslTcQ1q2cqtz4KrjvYsrEVAHClbnsU8=
github.com/hugo-toha/toha/v4 v4.0.0/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ=
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"@fortawesome/fontawesome-free": "github.com/hugo-toha/toha/v4",
"autoprefixer": "github.com/hugo-toha/toha/v4",
"bootstrap": "github.com/hugo-toha/toha/v4",
"darkreader": "github.com/hugo-toha/toha/v4",
"eslint": "github.com/hugo-toha/toha/v4",
"eslint-config-prettier": "github.com/hugo-toha/toha/v4",
"eslint-config-standard": "github.com/hugo-toha/toha/v4",
Expand Down Expand Up @@ -37,7 +36,6 @@
"@fortawesome/fontawesome-free": "^6.2.0",
"autoprefixer": "^10.4.13",
"bootstrap": "^4.6.2",
"darkreader": "^4.9.58",
"eslint": "^8.31.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-standard": "^17.0.0",
Expand Down