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

Have your builds push to GitHub Pages #9

Open
ryleu opened this issue Dec 9, 2022 · 0 comments
Open

Have your builds push to GitHub Pages #9

ryleu opened this issue Dec 9, 2022 · 0 comments

Comments

@ryleu
Copy link

ryleu commented Dec 9, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant