34 lines
895 B
YAML
34 lines
895 B
YAML
name: 11ty build and deploy for ${{ gitea.repository }}
|
|
run-name: 11ty build and deploy for ${{ gitea.repository }}
|
|
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 ${{ gitea.workspace }}
|
|
|
|
- name: Install dependencies
|
|
run: npm i
|
|
|
|
- name: Build 11ty site
|
|
run: npm run build
|
|
|
|
- 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 }}
|