alis-site-deploy #57
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: alis-site-deploy | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
HUGO_VERSION: 0.135.0 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
- uses: actions/checkout@v4 | |
with: | |
path: site/deploy/ | |
ref: gh-pages | |
- name: Environment information | |
run: | | |
uname -a | |
lsb_release -a | |
- name: Cache hugo resources | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-hugo-resources | |
with: | |
path: ./resources | |
key: ${{ runner.os }}-build-${{ env.cache-name }} | |
- name: Install packages (hugo) | |
run: | | |
wget https://github.com/gohugoio/hugo/releases/download/v${{ env.HUGO_VERSION }}/hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz | |
tar xzf hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz hugo | |
rm hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz | |
chmod +x ./hugo | |
sudo mv ./hugo /usr/local/bin | |
- name: Echo content (deploy) | |
run: | | |
ls site/deploy/ | |
- name: Generate content | |
run: | | |
cd site/ | |
hugo gen chromastyles --style=github > themes/alis/assets/syntax.css | |
hugo --destination="deploy/" --gc --cleanDestinationDir | |
- name: Echo content (deploy) | |
run: | | |
ls site/deploy/ | |
- name: Deploy | |
run: | | |
cd site/deploy/ | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "Site update at `LC_ALL=en_US.utf8 date +%Y-%m-%dT%H:%M:%S%z`" | |
git push origin gh-pages | |
cd .. | |