1
0

Create staging workflow

This commit is contained in:
suroh 2025-03-28 18:41:50 +01:00
parent b7ba078549
commit 0eb8d9f828

@ -0,0 +1,32 @@
name: 11ty build and deploy for STAGING ${{ gitea.repository }}
run-name: 11ty build and deploy for STAGING ${{ gitea.repository }}
on:
push:
branches: [ 'staging' ]
jobs:
build-deploy:
runs-on: node-22
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/staging-${{ gitea.event.repository.name }} ]; then mkdir /www/${{ gitea.event.repository.name }}; fi
- name: Copy built website
run: cp -r _site/. /www/staging-${{ gitea.event.repository.name }}
- name: Fix ownership
run: chown -R www-data:www-data /www/staging-${{ gitea.event.repository.name }}