Merge pull request #611 from pep-dortmund/vorstand25 #393
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: Upload | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
# Every Sunday at 23:00 UTC | |
- cron: "0 23 * * 0" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.2" | |
bundler-cache: true | |
- name: build | |
run: bundle exec jekyll build | |
- name: upload | |
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" |