added gitea workflow

This commit is contained in:
Thies Lennart Alff 2024-02-27 19:54:10 +01:00
parent 17c0dee9d3
commit 50cbd1ef55
2 changed files with 24 additions and 36 deletions

View file

@ -0,0 +1,24 @@
name: build and deploy website
run-name: ${{ gitea.actor }} is building the website
on:
push:
branches:
- main
jobs:
deploy-main:
runs-on: ubuntu-latest
steps:
- run: echo "Automatically triggered by ${{ gitea.event_name }}"
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
github-server-url: 'https://git.lennartalff.net'
- name: Install dependencies
run: apt update && apt install -y rsync hugo
- name: Build
run: hugo --minify
- name: Test
run: ls ${{ gitea.workspace }}
- run: echo "Finished with status: ${{ job.status }}"

View file

@ -1,36 +0,0 @@
name: "Build and Deploy"
on:
push:
branches:
- main
pull_request:
branches:
- "*"
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
- name: Build
run: hugo --minify
- name: Deploy
uses: burnett01/rsync-deployments@5.2.1
if: github.ref == 'refs/heads/main'
with:
switches: -avzr --delete
path: public/
remote_path: ${{ secrets.DEPLOY_PATH }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
remote_key_pass: ${{ secrets.DEPLOY_KEY_PASS }}