Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
51 changes: 22 additions & 29 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# Sample workflow for building and deploying a Hugo site to GitHub Pages
# Build the Hugo site and publish it to the `gh-pages` branch, which is the
# configured GitHub Pages source for this repository.
name: Deploy Hugo site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Build-only validation on pull requests (no deploy)
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# The GITHUB_TOKEN needs write access to push the built site to `gh-pages`
permissions:
contents: read
pages: write
id-token: write
contents: write

# Allow one concurrent deployment
concurrency:
Expand All @@ -26,7 +28,6 @@ defaults:
shell: bash

jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
Expand All @@ -36,15 +37,10 @@ jobs:
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: Install Dart Sass Embedded
run: sudo snap install dart-sass-embedded
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
Expand All @@ -54,21 +50,18 @@ jobs:
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
--baseURL "https://animeeffectsdevs.github.io/"
- name: Publish to gh-pages
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd public
git init --initial-branch=gh-pages
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit --message "Deploy ${GITHUB_SHA:0:7}"
git push --force "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages
13 changes: 13 additions & 0 deletions assets/js/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// The theme's bundled updateDate() has a long-standing bug: it assigns
// `year.innerHTML` (the number) instead of `yearEl.innerHTML`, so the footer
// copyright year is never refreshed client-side. This overrides the theme's
// `assets/js/custom.js`, which is concatenated last into js/bundle.js.
//
// Keep the copyright year current even when the site was built in an earlier
// year (stale cache, missed deploys).
(function updateCopyrightYear() {
var yearEl = document.querySelector('footer .year');
if (yearEl) {
yearEl.textContent = String(new Date().getFullYear());
}
})();
2 changes: 1 addition & 1 deletion config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ centerLogo = true
# optional
# attribution. Feel free to delete this
[author]
name = "AnimeEffectDevs"
name = "AnimeEffectsDevs"
url = "https://github.com/AnimeEffectsDevs?type=source"
Loading