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

34 lines
788 B
YAML

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