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

Add dart sass to actions #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions .github/workflows/docs-to-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.110.0'
hugo-version: "0.110.0"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to hugo docs, dart sass is compatible with 0.114.0.
Do we have to update the hugo-version here as well? 🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I missed that, looks like that will need changing then. The action that just ran builds the old version so its not using dart-sass anyway

extended: true

- uses: dw-labs-org/dart-sass-gha@v1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your efforts here to creating this action! Really appreciate it 🙏
However, I think using an action here is a bit overkill.
We can install it right out of the snap repo:

- name: Install Dart Sass
  run: sudo snap install dart-sass

This is also what the hugo docs say 🙃 So I would follow that advise.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what I thought... but I couldn't get it to work. Looking back I have a feeling it might have been a path issue so it might be a case of adding:

- run: echo "/snap/bin" >> $GITHUB_PATH

Which is easier to maintain than an action, although it was good to learn how to do it.

If you install hugo with a snap I think dart-sass is included so maybe that's even easier.


- name: Build
working-directory: docs
run: hugo --minify
Expand All @@ -26,5 +28,5 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true
commit_message: '[skip ci] Deploy:'
commit_message: "[skip ci] Deploy:"
publish_dir: docs/public
6 changes: 4 additions & 2 deletions .github/workflows/fresh-to-vercel-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.110.0'
hugo-version: "0.110.0"
extended: true

- uses: dw-labs-org/dart-sass-gha@v1

- name: Build with Hugo on PR
working-directory: exampleSite
run: |
Expand All @@ -38,4 +40,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: alias-domain
path: alias-domain/
path: alias-domain/
12 changes: 7 additions & 5 deletions .github/workflows/fresh-to-vercel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.110.0'
hugo-version: "0.110.0"
extended: true

- uses: dw-labs-org/dart-sass-gha@v1

- name: Build with Hugo on master
working-directory: exampleSite
run: |
Expand All @@ -28,9 +30,9 @@ jobs:
- name: Deploy to Vercel on master
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}}
vercel-project-name: hugo-fresh
vercel-args: '--prod'
working-directory: ./exampleSite/public
vercel-args: "--prod"
working-directory: ./exampleSite/public
6 changes: 4 additions & 2 deletions .github/workflows/htmltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:
push:
branches:
- master
- master
pull_request:

jobs:
Expand All @@ -27,6 +27,8 @@ jobs:
hugo-version: "latest"
extended: true

- uses: dw-labs-org/dart-sass-gha@v1

- run: hugo --destination $GITHUB_WORKSPACE/exampleSite/public --themesDir ../../ --theme hugo-fresh
working-directory: exampleSite

Expand All @@ -44,4 +46,4 @@ jobs:
with:
name: htmltest-report
path: tmp/.htmltest/htmltest.log
retention-days: 7 # default is 90 days
retention-days: 7 # default is 90 days