1
0
web-semprace/.gitea/workflows/build_and_deploy.yaml

48 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2023-12-07 19:02:09 +01:00
name: Build and Deploy Zola Website
on:
push:
branches:
- master
- dev
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Zola
uses: taiki-e/install-action@v2
with:
tool: zola@0.17.2
- name: Build Zola Website
run: |
zola build
- name: Remove unwanted pages
run: bash ./delete_pages.sh
2023-12-07 19:02:09 +01:00
2023-12-07 20:22:56 +01:00
- name: Set Destination Folder if MASTER
if: ${{ github.ref == 'refs/heads/master' }}
2023-12-07 20:25:19 +01:00
run: echo "DEST_FOLDER=/srv/www/cz/pkmples/www" >> $GITHUB_ENV
2023-12-07 20:22:56 +01:00
- name: Set Destination Folder if DEV
if: ${{ github.ref == 'refs/heads/dev' }}
2023-12-07 20:25:19 +01:00
run: echo "DEST_FOLDER=/srv/www/cz/pkmples/dev" >> $GITHUB_ENV
2023-12-07 20:14:19 +01:00
2023-12-07 19:02:09 +01:00
- 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: "./public/"
SERVER_IP: ${{ secrets.SERVER_IP }}
USERNAME: ${{ secrets.USERNAME }}
2023-12-07 20:14:19 +01:00
SERVER_DESTINATION: ${{ env.DEST_FOLDER }}
2023-12-07 19:02:09 +01:00