Skip to content

feat: use own rsync deploy #221

feat: use own rsync deploy

feat: use own rsync deploy #221

Workflow file for this run

name: DEPLOY
on:
push:
branches:
- main
jobs:
deploy:
if: github.repository_owner == 'freifunkMUC'
strategy:
fail-fast: false
matrix:
target: [webfrontend03, webfrontend04, webfrontend05, webfrontend06]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Ruby environment
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true # Enables caching for Bundler
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
- name: Build Jekyll site
run: bundle exec jekyll build
- name: Verify _site directory
run: ls -al ${{ github.workspace }}/_site
- name: Deploy via SSH and rsync
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh
echo "$DEPLOY_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ matrix.target }}.ext.ffmuc.net >> ~/.ssh/known_hosts
rsync -avzvr --delete \
${{ github.workspace }}/_site/ \
deploy-ffmuc@${{ matrix.target }}.ext.ffmuc.net:/srv/www/ffmuc.net/