Add post about Chicago moving containers #155
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: Build and Deploy Hugo | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'content/posts/Drafts/**' | |
- '.github/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
#lfs: true | |
submodules: true | |
fetch-depth: '0' | |
- name: Create LFS file list | |
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id | |
- name: Restore LFS cache | |
uses: actions/cache@v3 | |
id: lfs-cache | |
with: | |
path: .git/lfs | |
key: ${{ runner.os }}-lfs-v1-${{ hashFiles('.lfs-assets-id') }} | |
restore-keys: | # can restore old caches because they'll get updated with new files on pull | |
${{ runner.os }}-lfs-v1 | |
- name: Git LFS Pull | |
run: git lfs pull | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.96.0' | |
extended: true | |
- name: Run the Hugo build | |
run: hugo -v --minify | |
- name: Create .gz files | |
run: find public/ -type f \( -name '*.html' -o -name '*.js' -o -name '*.css' -o -name '*.xml' -o -name '*.svg' \) -exec gzip -v -k -f -n --best {} \; | |
- name: Deploy to server | |
id: deploy | |
uses: EMH333/[email protected] | |
env: | |
DEPLOY_KEY: ${{secrets.DEPLOY_KEY}} | |
with: | |
flags: '-vzcr --delete' | |
options: '' | |
ssh_options: '' | |
src: 'public/' | |
dest: 'emh-web-deploy@${{ secrets.DEPLOY_SERVER }}:/var/www/html/ethohampton.com' |