-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (54 loc) · 2.11 KB
/
build-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Build and Deploy
on:
push:
branches:
- main
# Sustainability: Don't trigger build for updated README
paths-ignore:
- "**/README.md"
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Use Node LTS
uses: actions/setup-node@v3
with:
node-version: "18" # lts
# This build runs with path prefix for github pages (hosted on subdirectory),
# for example https://<USER>.github.io/<REPO-NAME>/
# See: https://www.11ty.dev/docs/config/#deploy-to-a-subdirectory-with-a-path-prefix
# - name: Install and Build for Github Pages 🔧
# run: |
# npm ci
# npm run build
# env:
# # https://vitepress.vuejs.org/config/basics.html#base
# BASE_PATH: "/${{ github.event.repository.name }}/"
# Important > GitHub repo > settings > Actions -->
# Allow read AND write for Github Action token, otherwise this will result in a error (as deploy action tries to push)
# See https://github.com/JamesIves/github-pages-deploy-action/discussions/1104#discussioncomment-2678741
# - name: Deploy 🚀
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages # The branch the action should deploy to.
# folder: docs/.vitepress/dist # The folder the action should deploy.
- name: Install and Build 🔧
run: |
npm ci
npm run build
ls -lsa
echo "/home/sites/${{ secrets.SSH_ACCOUNT_ID }}/web/my-ddev-lab.mandrasch.eu/"
# transfer to separate webspace
- name: rsync deployments
uses: burnett01/[email protected]
with:
# be careful with delete!
switches: -avzr --delete
path: docs/.vitepress/dist/
# e.g. /var/www/html/
remote_path: "/home/sites/${{ secrets.SSH_ACCOUNT_ID }}/web/my-ddev-lab.mandrasch.eu/"
remote_host: ${{ secrets.SSH_HOST }}
remote_user: ${{ secrets.SSH_USER }}
remote_key: ${{ secrets.SSH_KEY }}