2024-11-26 22:08:33 +01:00
|
|
|
name: Build Everything
|
2024-11-26 21:06:28 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2024-11-26 22:08:33 +01:00
|
|
|
sass_compile:
|
2024-11-26 21:06:28 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: cicd-docs
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Git submodules
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2024-11-26 22:08:33 +01:00
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: '8.4'
|
|
|
|
extensions: none
|
|
|
|
|
2024-11-26 21:06:28 +01:00
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 'latest'
|
|
|
|
|
|
|
|
- name: Install SASS Compiler
|
|
|
|
run: |
|
2024-11-26 22:08:33 +01:00
|
|
|
npm install -g sass
|
2024-11-26 21:06:28 +01:00
|
|
|
|
|
|
|
- name: Compile SASS
|
|
|
|
run: |
|
|
|
|
cd htdocs/css/
|
|
|
|
sass "../../scss/nibblepoker.scss" -q --no-source-map > "nibblepoker.css"
|
|
|
|
sass "../../scss/nibblepoker.scss" -q --no-source-map --style compressed > "nibblepoker.min.css"
|
|
|
|
sass "../../scss/debugger.scss" -q --no-source-map > "debugger.css"
|
|
|
|
sass "../../scss/debugger.scss" -q --no-source-map --style compressed > "debugger.min.css"
|
|
|
|
|
|
|
|
- name: Upload `.css` build artifact
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
if: ${{ github.actor == 'aziascreations' }}
|
|
|
|
with:
|
|
|
|
name: nibblepoker.css
|
|
|
|
path: "./htdocs/css/nibblepoker.css"
|
|
|
|
if-no-files-found: error
|
|
|
|
retention-days: 90
|
|
|
|
compression-level: 9
|
|
|
|
|
|
|
|
- name: Upload `.min.css` build artifact
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
if: ${{ github.actor == 'aziascreations' }}
|
|
|
|
with:
|
|
|
|
name: nibblepoker.min.css
|
|
|
|
path: "./htdocs/css/nibblepoker.min.css"
|
|
|
|
if-no-files-found: error
|
|
|
|
retention-days: 90
|
|
|
|
compression-level: 9
|
2024-11-26 22:08:33 +01:00
|
|
|
|
|
|
|
- name: Pre-render PHP File
|
|
|
|
run: |
|
|
|
|
cd htdocs
|
|
|
|
php ./index.php > ./index.html
|
|
|
|
|
|
|
|
- name: Remove trash
|
|
|
|
run: |
|
|
|
|
cd htdocs
|
|
|
|
rm -rf parts/
|
|
|
|
rm *.php
|
|
|
|
|
|
|
|
- name: Deploy demo page to gh-pages
|
|
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./htdocs
|