2021-07-25 22:52:44 +02:00
|
|
|
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
|
2021-07-27 17:28:52 +02:00
|
|
|
- name: Wrong domain check
|
|
|
|
run: |
|
|
|
|
echo "$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }})"
|
|
|
|
if git grep -q -E ${{ secrets.DOMAIN }} -- *.css; then
|
|
|
|
echo "Game over man!"
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-07-25 22:52:44 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-07-28 20:03:54 +02:00
|
|
|
#- name: Auto Minify
|
|
|
|
# uses: nizarmah/auto-minify@master
|
2021-07-25 22:52:44 +02:00
|
|
|
|
2021-07-28 20:03:54 +02:00
|
|
|
#- name: Remove .min suffix from minified files
|
|
|
|
# run: find ./CSS -depth -name "*.min.*" -exec sh -c 'mv "$1" "${1%.*.*}.${1##*.}"' _ {} \;
|
2021-07-25 22:52:44 +02:00
|
|
|
|
|
|
|
- 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 }}
|