updated meta desc #43
This file contains 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: Publish to GH Pages | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Checkout destination | |
uses: actions/checkout@v3 | |
if: github.ref == 'refs/heads/main' | |
with: | |
ref: gh-pages | |
path: built-site | |
submodules: true | |
- name: Setup Hugo | |
run: | | |
curl -L -o /tmp/hugo.tar.gz 'https://github.com/gohugoio/hugo/releases/download/v0.124.1/hugo_0.124.1_linux-amd64.tar.gz' | |
tar -C ${RUNNER_TEMP} -zxvf /tmp/hugo.tar.gz hugo | |
- name: Clean and Rebuild | |
run: | | |
rm -rf public | |
${RUNNER_TEMP}/hugo --minify & | |
${RUNNER_TEMP}/hugo --minify & | |
wait | |
- name: Cache Hugo Modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/hugo_modules | |
key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum') }} | |
- name: Gzip Compression | |
run: | | |
find public -type f \( -name "*.html" -o -name "*.css" -o -name "*.js" \) -exec gzip -9 -k {} \; | |
find public -type f \( -name "*.html.gz" -o -name "*.css.gz" -o -name "*.js.gz" \) -exec mv {} {}.gz \; | |
- name: Deploy | |
if: github.ref == 'refs/heads/main' | |
run: | | |
cp -R public/* ${GITHUB_WORKSPACE}/built-site/ | |
cd ${GITHUB_WORKSPACE}/built-site | |
git add . | |
git config user.name 'Satadru Mallick' | |
git config user.email '[email protected]' | |
git commit -m 'Updated site with minified and gzipped assets' | |
git push |