Coding dojo du 7 Mars 2025 #264
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 site | |
on: | |
push: | |
branches: [ dev ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup git | |
run: | | |
git config --global user.email "swcrafter@lyontechhub.org" | |
git config --global user.name "Github Action" | |
- name: Update repository | |
run: | | |
git fetch | |
git submodule update --init --recursive | |
- name: Initialize output directory | |
run: git worktree add ./dist remotes/origin/master | |
- name: Download hugo | |
run: | | |
wget "https://github.com/gohugoio/hugo/releases/download/v0.111.3/hugo_0.111.3_Linux-64bit.tar.gz" | |
tar x -zvf hugo*.tar.gz | |
- name: Run hugo | |
run: ./hugo -d dist | |
- name: Publish | |
run: | | |
cd dist | |
git add . | |
git commit -m "regenerate of dev" | |
git push "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:master |