Skip to content

Commit daa3819

Browse files
Set Netlify workflow task to use lfs + LFS tracking
1 parent 437f05c commit daa3819

2 files changed

Lines changed: 43 additions & 11 deletions

File tree

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.mov filter=lfs diff=lfs merge=lfs -text
2+
*.mp4 filter=lfs diff=lfs merge=lfs -text
3+
*.png filter=lfs diff=lfs merge=lfs -text
4+
*.jpg filter=lfs diff=lfs merge=lfs -text

.github/workflows/hugo.yml

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,44 @@ jobs:
4141
run: |
4242
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
4343
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
44-
# - name: Install Dart Sass
45-
# run: sudo snap install dart-sass
44+
45+
- name: Install Dart Sass
46+
run: sudo snap install dart-sass
4647
- name: Checkout
4748
uses: actions/checkout@v4
4849
with:
4950
submodules: recursive
51+
fetch-depth: 0
5052
- name: Setup Pages
5153
id: pages
52-
uses: actions/configure-pages@v4
54+
uses: actions/configure-pages@v5
5355
- name: Install Node.js dependencies
5456
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
57+
- name: Cache Restore
58+
id: cache-restore
59+
uses: actions/cache/restore@v4
60+
with:
61+
path: |
62+
${{ runner.temp }}/hugo_cache
63+
key: hugo-${{ github.run_id }}
64+
restore-keys:
65+
hugo-
5566
- name: Build with Hugo
56-
env:
57-
# For maximum backward compatibility with Hugo modules
58-
HUGO_ENVIRONMENT: production
59-
HUGO_ENV: production
6067
run: |
6168
hugo \
69+
--gc \
6270
--minify \
63-
--baseURL "${{ steps.pages.outputs.base_url }}/"
71+
--baseURL "${{ steps.pages.outputs.base_url }}/" \
72+
--cacheDir "${{ runner.temp }}/hugo_cache"
73+
- name: Cache Save
74+
id: cache-save
75+
uses: actions/cache/save@v4
76+
with:
77+
path: |
78+
${{ runner.temp }}/hugo_cache
79+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
6480
- name: Upload artifact
65-
uses: actions/upload-pages-artifact@v2
81+
uses: actions/upload-pages-artifact@v3
6682
with:
6783
path: ./public
6884

@@ -76,14 +92,26 @@ jobs:
7692
steps:
7793
- name: Deploy to GitHub Pages
7894
id: deployment
79-
uses: actions/deploy-pages@v3
95+
uses: actions/deploy-pages@v4
8096

8197
# update netlify
8298
netlify:
8399
runs-on: ubuntu-latest
84-
if: ${{ github.event_name == 'schedule' }}
100+
#if: ${{ github.event_name == 'schedule' }}
85101
needs: build
86102
steps:
103+
- name: Checkout repository with LFS
104+
uses: actions/checkout@v4
105+
with:
106+
lfs: true
107+
submodules: recursive
108+
- name: Install Git LFS
109+
run: |
110+
sudo apt-get update
111+
sudo apt-get install git-lfs
112+
git lfs install
113+
- name: Pull Git LFS files
114+
run: git lfs pull
87115
- name: update netlify
88116
id: netlify
89117
run:

0 commit comments

Comments
 (0)