Merge pull request #384 from pep-dortmund/blog_input_in_tblr #1192
This file contains hidden or 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, Verify and deploy on main | |
on: | |
push: | |
branches: | |
- "**" | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v5 | |
- name: Setup ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.3" | |
bundler-cache: true | |
- name: Build the website | |
run: bundle exec jekyll build | |
- name: Check the build | |
run: | | |
bundle exec htmlproofer ./_site \ | |
--allow-hash-href \ | |
--check-html \ | |
--only-4xx \ | |
--disable-external \ | |
--empty-alt-ignore | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v4 | |
with: | |
name: toolbox-homepage-build | |
path: ./_site | |
deploy: | |
needs: build | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v5 | |
- name: Download artifact | |
uses: actions/download-artifact@v5 | |
with: | |
name: toolbox-homepage-build | |
path: ./_site | |
- name: Unpack artifact | |
run: | | |
tar -xvf ./_site/artifact.tar -C ./_site/ | |
rm -rf ./_site/artifact.tar | |
- name: Upload to server | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
DEPLOY_USER: ${{ secrets.DEPLOY_USER }} | |
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} | |
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} | |
run: | | |
mkdir -p ~/.ssh | |
ssh-keyscan -t rsa "$DEPLOY_HOST" 2> /dev/null | sort -u -o ~/.ssh/known_hosts | |
echo "$DEPLOY_KEY" > ~/.ssh/deploy_key | |
eval "$(ssh-agent -s)" | |
chmod 600 ~/.ssh/deploy_key | |
ssh-add ~/.ssh/deploy_key | |
rsync -rq --links --delete --exclude=".*" ./_site/ "$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH" |