Skip to content

Delete .github/workflows/jekyll.yml #14

Delete .github/workflows/jekyll.yml

Delete .github/workflows/jekyll.yml #14

name: Deploy to DeNBI Faroe server
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set deployment path
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "DEPLOY_PATH=/var/www/production/knowledgebase.nfdi4microbiota.de" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
echo "DEPLOY_PATH=/var/www/development/knowledgebase.nfdi4microbiota.de" >> $GITHUB_ENV
else
echo "Unknown branch. Skipping deployment."
exit 1
fi
- name: Build Jekyll site with Docker
run: |
docker run --rm -v $PWD:/srv/jekyll -v $PWD/vendor/bundle:/usr/local/bundle \
jekyll/jekyll:latest jekyll build -d _site
- name: Deploy to server
run: |
sudo rm -rf $DEPLOY_PATH/*
sudo cp -r _site/* $DEPLOY_PATH/
sudo chown -R www-data:www-data $DEPLOY_PATH
- name: Cleanup build artifacts
run: |
sudo rm -rf $GITHUB_WORKSPACE/*
docker system prune -f