-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
43 lines (41 loc) · 1.01 KB
/
.gitlab-ci.yml
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
stages:
- build
- deploy
build:site:
image: node:20
stage: build
script:
- npm install
- npm run build
- npm run generate
artifacts:
expire_in: 6 hours
paths:
- .output/public
- .output/server
- nitro.json
only:
refs:
- master
deploy:prod:
image: alpine
rules:
- if: '$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main"'
when: always
stage: deploy
before_script:
- 'which ssh-agent || ( apk add --update openssh )'
- apk add --update bash
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY_TINYPC" | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
# Install rsync
- apk add rsync
- rsync --version
script:
- rsync -avz --delete -e 'ssh -p 1986' .output/public/. [email protected]:/var/www/nuxstr.nostrver.se
- echo "Deployment ready, check https://nuxstr.nostrver.se"
dependencies:
- build:site