Skip to content

add image compressor (#13) #10

add image compressor (#13)

add image compressor (#13) #10

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build and Deploy
on:
push:
branches: ['main']
jobs:
build:
environment: github-pages
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [19.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Setup Secrets
env:
ENV_GITHUB_TOKEN: ${{ secrets.ENV_GITHUB_TOKEN }}
ENV_ENABLE_SERVICEWORKER: ${{ secrets.ENV_ENABLE_SERVICEWORKER }}
run: |
touch .env
echo ENV_GITHUB_TOKEN="$ENV_GITHUB_TOKEN" >> .env
echo ENV_ENABLE_SERVICEWORKER="$ENV_ENABLE_SERVICEWORKER" >> .env
- name: Build HTML
run: |
npm ci
npm run build
- name: Edit .gitignore
run: |
echo "/github-pages-deploy-action-temp-deployment-folder" > ./public/.gitignore
- name: Add .nojekyll
run: |
cd public
touch .nojekyll
- name: Minify Code
uses: Lenni009/minify-js@main
with:
directory: public
overwrite: true
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: public # The folder the action should deploy.