do_gitlab_deploy #299
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: Deploy | |
on: | |
repository_dispatch: ~ | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout master | |
uses: actions/checkout@v3 | |
with: { fetch-depth: 0 } | |
- name: Checkout gh-pages | |
run: git worktree add -B gh-pages public remotes/origin/gh-pages | |
- name: Clean previous | |
run: | | |
find public -mindepth 1 -maxdepth 1 '!' -name .git -exec rm -rf '{}' '+' | |
- name: Build site | |
uses: pdidev/pdidev.github.io/.github/actions/deploy@main | |
with: | |
output-directory: public | |
gitlab-url: https://gitlab.maisondelasimulation.fr | |
project-name: pdidev%2Fpdi | |
- name: Add static data | |
run: | | |
find data -mindepth 1 -maxdepth 1 -exec cp -r '{}' public ';' | |
- name: Add sitemap | |
run: | | |
./gen_sitemap public | |
- name: Push | |
run: | | |
cd public | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@noreply.example.com" | |
git add -A . | |
git commit -a -m "Update to match ${GITHUB_SHA} by ${GITHUB_EVENT_NAME} ${GITHUB_RUN_NUMBER}" | |
git push -f |