2020-09-23 10:13:24 +02:00
|
|
|
name: CSS (node-sass)
|
2020-10-29 18:26:15 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-03-22 08:03:51 +01:00
|
|
|
branches:
|
|
|
|
- main
|
2020-10-29 18:26:15 +01:00
|
|
|
pull_request:
|
2021-12-02 22:02:11 +01:00
|
|
|
workflow_dispatch:
|
2020-10-29 18:26:15 +01:00
|
|
|
|
2020-01-23 17:57:00 +01:00
|
|
|
env:
|
2020-11-23 20:32:25 +01:00
|
|
|
FORCE_COLOR: 2
|
2022-11-13 15:19:29 +01:00
|
|
|
NODE: 18
|
2020-01-23 17:57:00 +01:00
|
|
|
|
2022-12-16 08:20:12 +01:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-01-23 17:57:00 +01:00
|
|
|
jobs:
|
|
|
|
css:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Clone repository
|
2022-03-02 15:51:46 +01:00
|
|
|
uses: actions/checkout@v3
|
2022-11-09 08:21:55 +01:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2020-01-23 17:57:00 +01:00
|
|
|
|
2020-10-29 18:26:15 +01:00
|
|
|
- name: Set up Node.js
|
2022-03-01 14:19:34 +01:00
|
|
|
uses: actions/setup-node@v3
|
2020-01-23 17:57:00 +01:00
|
|
|
with:
|
|
|
|
node-version: "${{ env.NODE }}"
|
|
|
|
|
2020-09-23 10:13:24 +02:00
|
|
|
- name: Build CSS with node-sass
|
2020-01-23 17:57:00 +01:00
|
|
|
run: |
|
2020-09-23 10:13:24 +02:00
|
|
|
npx --package node-sass@latest node-sass --version
|
|
|
|
npx --package node-sass@latest node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 scss/ -o dist-sass/css/
|
2020-01-23 17:57:00 +01:00
|
|
|
ls -Al dist-sass/css
|
2023-03-27 17:34:14 +02:00
|
|
|
|
|
|
|
# Check that there are no Sass variables (`$`)
|
|
|
|
- name: Check built CSS files
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
if [[ $(find dist-sass/css/ -name "*.css" | xargs grep -F "\$" | wc -l | bc) -eq 0 ]]; then
|
|
|
|
echo "All good, no Sass variables found"
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo "Found Sass variables!"
|
|
|
|
exit 1
|
|
|
|
fi
|