lewisdale.dev/.gitea/workflows/build-and-copy.yaml
Lewis Dale 91f05d9824
Some checks failed
Build and copy to prod / build-and-copy (push) Failing after 1m43s
Try to use scp to copy the built site to the server
2024-03-07 14:02:57 +00:00

25 lines
712 B
YAML

name: Build and copy to prod
on:
push:
jobs:
build-and-copy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install dependencies 📦
run: npm ci
- name: Build eleventy
run: npm run build
env:
NODE_ENV: production
OMNIVORE_API_KEY: ${{ secrets.OMNIVORE_API_KEY }}
- name: Create ssh key
run: mkdir ~/.ssh && echo "${{ secrets.SSH_KEY }}" >> ~/.ssh/id_rsa
- name: Copy _site to prod
run: scp -rp _site/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/html