work.suroh.tk/.gitea/workflows/deploy.yml

37 lines
917 B
YAML

name: 11ty build and deploy for work.suroh.tk
run-name: 11ty build and deploy for work.suroh.tk
on:
push:
branches:
- 'main'
jobs:
build-deploy:
runs-on: ubuntu-latest
container:
volumes:
- /www
steps:
- name: Clone code to runner
uses: actions/checkout@v4
- name: Move to directory
run: cd ${{ gitea.workspace }}
- name: Install dependencies
run: npm i
- name: Build 11ty site
run: npm run build
- name: Check folders
run: ls -lh /
- name: Create folder if needed
run: if [ ! -d /www/${{ gitea.event.repository.name }} ]; then mkdir /www/${{ gitea.event.repository.name }}; fi
- name: Copy built website
run: cp -r _site/. /www/${{ gitea.event.repository.name }}
- name: Fix ownership
run: chown -R www-data:www-data /www/${{ gitea.event.repository.name }}