From a120b42edaa9736705ff106603e1637b01a11d27 Mon Sep 17 00:00:00 2001 From: gilbN Date: Sun, 25 Jul 2021 22:52:44 +0200 Subject: [PATCH] add minify CSS & deploy GHP workflow --- .github/workflows/minify-and-deploy.yml | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/minify-and-deploy.yml diff --git a/.github/workflows/minify-and-deploy.yml b/.github/workflows/minify-and-deploy.yml new file mode 100644 index 00000000..c11f90db --- /dev/null +++ b/.github/workflows/minify-and-deploy.yml @@ -0,0 +1,27 @@ +name: Minify CSS and deploy to live branch +on: + push: + branches: + - master +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/checkout@v2 + + - name: Auto Minify + uses: nizarmah/auto-minify@master + + - name: Remove .min suffix from minified files + run: find ./CSS -depth -name "*.min.*" -exec sh -c 'mv "$1" "${1%.*.*}.${1##*.}"' _ {} \; + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/master' }} + with: + publish_dir: ./ + publish_branch: live + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file