Web/.forgejo/workflows/main.yml

31 lines
1.1 KiB
YAML
Raw Normal View History

2024-01-13 18:59:43 +01:00
on:
push:
branches: [master]
2024-01-13 18:59:43 +01:00
jobs:
web:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Ruby
2024-01-13 19:01:00 +01:00
uses: https://github.com/ruby/setup-ruby@v1
2024-01-13 18:59:43 +01:00
with:
ruby-version: 3.2.2
2024-01-14 11:48:12 +01:00
bundler-cache: true
2024-01-13 18:59:43 +01:00
- name: Build
2024-06-14 17:49:53 +02:00
run: bundle exec jekyll build
2024-01-13 18:59:43 +01:00
- name: Deploy
run: |
2024-01-13 20:29:53 +01:00
apt update && apt install -y rsync
2024-01-13 18:59:43 +01:00
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && sudo dpkg -i cloudflared.deb
2024-01-13 20:26:07 +01:00
echo "${{ secrets.ELLBOT_KEY }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
2024-06-14 17:49:53 +02:00
rsync -rv --delete -e 'ssh -o "ProxyCommand cloudflared access ssh --hostname %h" -o "StrictHostKeyChecking=no"' _site/ ellbot@ssh.ellpeck.de:/var/www/ellpeck
2024-05-06 22:47:31 +02:00
- name: Purge Cloudflare cache
uses: https://github.com/NathanVaughn/actions-cloudflare-purge@v3.1.0
with:
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
cf_auth: ${{ secrets.CLOUDFLARE_TOKEN }}