2023-12-07 15:39:30 +01:00
|
|
|
name: Build Zola Website
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2023-12-07 17:08:32 +01:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2023-12-07 15:39:30 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
2023-12-07 15:51:35 +01:00
|
|
|
uses: actions/checkout@v2
|
2023-12-07 15:39:30 +01:00
|
|
|
|
2023-12-07 16:00:13 +01:00
|
|
|
- name: Set up Zola
|
|
|
|
uses: taiki-e/install-action@v2
|
2023-12-07 15:57:23 +01:00
|
|
|
with:
|
2023-12-07 16:00:13 +01:00
|
|
|
tool: zola@0.17.2
|
2023-12-07 15:39:30 +01:00
|
|
|
|
|
|
|
- name: Build Zola Website
|
|
|
|
run: |
|
|
|
|
zola build
|
|
|
|
|
2023-12-07 17:08:32 +01:00
|
|
|
deploy:
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master' && success()
|
|
|
|
steps:
|
|
|
|
- name: Deploy to server
|
2023-12-07 17:35:41 +01:00
|
|
|
run: |
|
|
|
|
scp "./public ${{ secrets.SERVER_IP }}:/srv/www/cz/pkmples/www"
|
|
|
|
# deploy:
|
|
|
|
# needs: build
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master' && success()
|
|
|
|
#
|
|
|
|
# steps:
|
|
|
|
# - name: Deploy to server
|
|
|
|
# uses: AEnterprise/rsync-deploy@v1.0.2
|
|
|
|
# env:
|
|
|
|
# DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
|
|
|
|
# ARGS: "-e -c -r --delete"
|
|
|
|
# SERVER_PORT: 22
|
|
|
|
# FOLDER: "./"
|
|
|
|
# SERVER_IP: ${{ secrets.SERVER_IP }}
|
|
|
|
# USERNAME: ${{ secrets.USERNAME }}
|
|
|
|
# SERVER_DESTINATION: "/srv/www/cz/pkmples/www"
|
|
|
|
#
|