generated from jlumbroso/hugo-github-example
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgraded deployment script (versions particularly)
- Loading branch information
Showing
1 changed file
with
36 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,59 @@ | ||
name: GitHub Pages Build | ||
name: ποΈ Build and Deploy GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Set a branch to deploy | ||
- main # Set a branch to deploy | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
actions: write | ||
checks: write | ||
contents: write | ||
deployments: write | ||
pull-requests: write | ||
repository-projects: write | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: π Check Out Source Repository | ||
uses: actions/[email protected] | ||
with: | ||
submodules: true # Fetch Hugo themes (true OR recursive) | ||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | ||
- name: Setup Node.js to build theme | ||
uses: actions/setup-node@v1 | ||
submodules: true # Fetch Hugo themes (true OR recursive) | ||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | ||
|
||
- name: π οΈ Initialize Hugo Environment | ||
uses: peaceiris/[email protected] | ||
with: | ||
node-version: 12 | ||
hugo-version: "0.124.1" | ||
extended: true | ||
|
||
- name: Setup Node.js to build theme | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Build Geekdoc theme (1/2) | ||
working-directory: ./themes/hugo-geekdoc | ||
run: npm install | ||
|
||
- name: Build Geekdoc theme (2/2) | ||
working-directory: ./themes/hugo-geekdoc | ||
run: gulp | ||
|
||
- name: Setup Hugo | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: "0.80.0" | ||
extended: true | ||
- name: ποΈ Compile Hugo Static Files | ||
run: hugo -D --gc --minify | ||
|
||
- name: Build website | ||
run: hugo --minify | ||
- name: π Secure Content with Encryption | ||
run: curl -L -o hugo-encrypt "https://github.com/Izumiko/hugo-encrypt/releases/download/v0.1.0/hugo-encrypt-linux-64" && chmod 755 hugo-encrypt && ./hugo-encrypt | ||
|
||
- name: Deploy to gh-pages branch | ||
uses: peaceiris/actions-gh-pages@v3 | ||
- name: π Publish to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3.9.3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_branch: gh-pages | ||
user_name: "github-actions[bot]" | ||
user_email: "github-actions[bot]@users.noreply.github.com" | ||
## NOTE: uncomment below if using a custom domain | ||
## cname: mydomain.com |