Skip to content

Commit 4a6ce9b

Browse files
Merge pull request #7 from LaunchCodeEducation/github-pages-migrate
minor edit to config, workflow for github pages
2 parents a144343 + 0dbdd91 commit 4a6ce9b

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

.github/workflows/hugo.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Deploy Hugo site to Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["main"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow one concurrent deployment
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: true
21+
22+
# Default to bash
23+
defaults:
24+
run:
25+
shell: bash
26+
27+
jobs:
28+
# Build job
29+
build:
30+
runs-on: ubuntu-latest
31+
env:
32+
HUGO_VERSION: 0.108.0
33+
steps:
34+
- name: Install Hugo CLI
35+
run: |
36+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
37+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
38+
- name: Install Dart Sass Embedded
39+
run: sudo snap install dart-sass-embedded
40+
- name: Checkout
41+
uses: actions/checkout@v3
42+
with:
43+
submodules: recursive
44+
- name: Setup Pages
45+
id: pages
46+
uses: actions/configure-pages@v3
47+
- name: Install Node.js dependencies
48+
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
49+
- name: Build with Hugo
50+
env:
51+
# For maximum backward compatibility with Hugo modules
52+
HUGO_ENVIRONMENT: production
53+
HUGO_ENV: production
54+
run: |
55+
hugo \
56+
--minify \
57+
--baseURL "https://education.launchcode.org/linux/"
58+
- name: Upload artifact
59+
uses: actions/upload-pages-artifact@v1
60+
with:
61+
path: ./public
62+
63+
# Deployment job
64+
deploy:
65+
environment:
66+
name: github-pages
67+
url: https://education.launchcode.org/linux/
68+
runs-on: ubuntu-latest
69+
needs: build
70+
steps:
71+
- name: Deploy to GitHub Pages
72+
id: deployment
73+
uses: actions/deploy-pages@v1

config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ canonifyURLs = true
77

88
[params]
99
themeVariant = ["lc-light", "lc-dark-blue", "lc-dark-blue-two"]
10-
editURL = "https://github.com/LaunchCodeEducation/linux/edit/master/content/"
10+
editURL = "https://github.com/LaunchCodeEducation/linux/edit/main/content/"
1111

1212
[outputs]
1313
home = ["HTML", "RSS", "JSON"]

0 commit comments

Comments
 (0)