Skip to content

Commit

Permalink
redeploy new workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
GoliathLabs authored Jan 6, 2025
1 parent 3856715 commit b18982d
Showing 1 changed file with 31 additions and 19 deletions.
50 changes: 31 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: DEPLOY

on:
push:
branches:
- main
- main

jobs:
deploy:
Expand All @@ -12,22 +13,33 @@ jobs:
matrix:
target: [webfrontend03, webfrontend04, webfrontend05, webfrontend06]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
# Use GitHub Actions' cache to shorten build times and decrease load on servers
- uses: actions/cache@v4.2.0
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- uses: lemonarc/jekyll-action@1.0.0
- name: rsync deployments
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
path: _site
remote_path: /srv/www/ffmuc.net/
remote_host: ${{ matrix.target }}.ext.ffmuc.net
remote_user: deploy-ffmuc
remote_key: ${{ secrets.DEPLOY_KEY }}
- 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 rsync
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
path: ${{ github.workspace }}/_site/
remote_path: /srv/www/ffmuc.net/
remote_host: ${{ matrix.target }}.ext.ffmuc.net
remote_user: deploy-ffmuc
rsh: -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa
remote_key: ${{ secrets.DEPLOY_KEY }}

0 comments on commit b18982d

Please sign in to comment.