-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
58 lines (54 loc) · 1.37 KB
/
.gitlab-ci.yml
File metadata and controls
58 lines (54 loc) · 1.37 KB
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
image: oven/bun:1
stages:
- build
- package
- deploy
build:
stage: build
only:
- docs
script:
- echo "Building the app"
- sh ./docs/build-static-website.sh
- mkdir -p $CI_PROJECT_DIR/public/
- cp -r ./docs/dist/* $CI_PROJECT_DIR/public/
artifacts:
paths:
- public/
expire_in: 1 week
package:
stage: package
only:
- docs
image: debian:bullseye
before_script:
- apt-get update && apt-get install -y zip
script:
- cd public
- zip -r ../apex-local-docs.zip ./*
- cd ..
- mkdir -p deploy
- mv apex-local-docs.zip deploy/
artifacts:
paths:
- deploy/apex-local-docs.zip
expire_in: 1 week
needs:
- build
deploy_to_production:
stage: deploy
tags:
- prod_web
only:
- docs
script:
- echo "Deploying on webserver"
- unzip -o deploy/apex-local-docs.zip -d /var/www/united-codes/products/uc-local-apex-dev/docs/
- sudo -n /bin/chown -R gitlab-deploy:gitlab-deploy /var/www/united-codes/products/uc-local-apex-dev/docs/
- sudo -n /usr/bin/find /var/www/united-codes/products/uc-local-apex-dev/docs/ -type d -exec chmod 755 {} \;
- sudo -n /usr/bin/find /var/www/united-codes/products/uc-local-apex-dev/docs/ -type f -exec chmod 644 {} \;
environment:
name: production_webserver
url: https://www.united-codes.com/products/uc-local-apex-dev/docs/
needs:
- package