new privacy policy with jsDelivr (and in English) #94
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: Hugo site CI | |
on: | |
push: | |
branches: | |
- master | |
- preview | |
pull_request: | |
branches: | |
- master | |
- preview | |
jobs: | |
build_job: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true # Fetch Hugo themes (true OR recursive) | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: '0.119.0' | |
- uses: Wohlstand/[email protected] | |
- name: Build site | |
run: chmod +x ci-build.sh && ./ci-build.sh ${{ github.sha }} ${{ github.run_id }} ${{ env.BRANCH_NAME }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: build | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build_job | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: build | |
path: /home/runner/work/blog/blog/build | |
- name: "Prepare SSH key and known hosts" | |
# https://github.com/symfony/cli/issues/227#issuecomment-601680974 | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan ${{ secrets.HOST }} >> ~/.ssh/known_hosts | |
- uses: Wohlstand/[email protected] | |
- name: Run deploy script | |
run: | | |
rsync -rSlh --stats build/ ${{ secrets.USERNAME }}@${{ secrets.HOST }}:${{ secrets.WEBPATH }}-${{ env.BRANCH_NAME }}/tar | |
ssh -o StrictHostKeyChecking=yes ${{ secrets.USERNAME }}@${{ secrets.HOST }} 'bash -s' -- < build/ci-deploy.sh ${{ secrets.WEBPATH }}-${{ env.BRANCH_NAME }} |