expand html #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple workflow for deploying static content to GitHub Pages | |
name: Minify to build branch | |
on: | |
push: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Checkout build branch | |
run: | | |
git checkout -b build || git checkout build | |
git merge main --no-ff | |
- name: Set up Git | |
run: | | |
git config user.name 'github-actions' | |
git config user.email '[email protected]' | |
- name: Minify HTML | |
uses: docker://textadi/minifier-compressor-html-action:v2 | |
env: | |
DIR: . | |
PARAM_MINIFY_CSS: True | |
PARAM_MINIFY_JS: True | |
- name: Commit minified files to build branch | |
run: | | |
git status | |
git add . | |
git commit -m "Minify HTML" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |