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
| name: Pages | ||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| workflow_dispatch: | ||
| jobs: | ||
| Deploy: | ||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
| environment: | ||
| name: github-pages | ||
| url: ${{steps.deployment.outputs.page_url}} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: '16' | ||
| - name: Install Dependencies | ||
| run: npm install -g terser csso-cli html-minifier | ||
| - name: Minify Files | ||
| - run: for file in $(find . -name '*.html'); do html-minifier --collapse-whitespace --remove-comments --remove-attribute-quotes --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true --file-ext html --output "$file" "$file"; done | ||
| - run: for file in $(find . -name '*.css'); do csso "$file" "$file"; done | ||
| - run: for file in $(find . -name '*.js'); do terser "$file" --output "$file"; done | ||
| - name: Setup Pages | ||
| uses: actions/configure-pages@v5 | ||
| - name: Upload Artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: . | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||