GeopJr / DNOME

Adwaita-inspired Discord Theme
https://dnome.geopjr.dev/
BSD 2-Clause "Simplified" License
128 stars 15 forks source link

Have your builds push to GitHub Pages #9

Open ryleu opened 1 year ago

ryleu commented 1 year ago

You could have your builds push to GitHub Pages so you don't have to use GitHack. Here's an example of how that workflow would look (I'm not able to PR it because I don't have access to create actions on your repos):

name: Compile & Push

on:
  push:
    branches:
      - main
      - master
      - dev

jobs:
  compile:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '18.x'
      - name: Install Less
        run: npm install -g less
      - name: Install the csso
        run: npm install -g csso-cli
      - name: Compile Less
        run: lessc ./src/DNOME.less ./dist/DNOME.css
      - name: Optimize CSS
        run: |
          csso ./dist/DNOME.css -o ./dist/DNOME.css --comments none --stat

          # csso downcases some pseudo content
          # escaped characters
          sed -i 's/\\a/\\A/g' ./dist/DNOME.css
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./dist
          keep_files: false
          full_commit_message: Publish compiled CSS

You would then enable GitHub pages on the gh-pages branch.