Skip to content

Commit

Permalink
Merge pull request #470 from freifunkMUC/workflows
Browse files Browse the repository at this point in the history
Update workflows to work with newer ruby versions
  • Loading branch information
GoliathLabs authored Jan 5, 2025
2 parents 358a217 + eb32f56 commit fec761c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 27 deletions.
46 changes: 27 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,29 @@ 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: Deploy via rsync
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 }}
25 changes: 17 additions & 8 deletions .github/workflows/stage-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
name: Build
on: [pull_request, push]

on:
pull_request:
push:

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
- name: Checkout Repository
uses: actions/checkout@v4

- uses: actions/cache@v4.2.0
- name: Set up Ruby environment
uses: ruby/setup-ruby@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- uses: lemonarc/jekyll-action@1.0.0
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

0 comments on commit fec761c

Please sign in to comment.