-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
63 lines (57 loc) · 2 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
image: timbru31/ruby-node:2.7-18
cache:
paths:
- vendor/
before_script:
- apt-get update
- apt-get install build-essential default-jre graphicsmagick imagemagick dh-autoreconf openssl default-jre awscli -y
- bundle install --path vendor
stages:
- build
- deploy
build:
stage: build
script:
- echo "=> Building web version ..."
- npm install -g pnpm
- pnpm install
- pnpm exec gulp
- JEKYLL_ENV=production bundle exec jekyll build --config _config.yml -d .site/
artifacts:
when: on_success
paths:
- .site
expire_in: 1h
website:
stage: deploy
script:
- echo "=> Upload to Website"
- export AWS_S3_BUCKET=wiki.pantherx.org
- export AWS_CLOUDFRONT_DISTRIBUTION_ID="$(echo "$LOCAL_AWS_CLOUDFRONT_DISTRIBUTION_ID")"
- export AWS_ACCESS_KEY_ID="$(echo "$LOCAL_AWS_ACCESS_KEY_ID")"
- export AWS_SECRET_ACCESS_KEY="$(echo "$LOCAL_AWS_SECRET_ACCESS_KEY")"
- aws s3 sync .site/ s3://${AWS_S3_BUCKET} --delete
- aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
only:
- master
# Pack and upload to S3
# package:
# stage: deploy
# script:
# - echo "=> Building desktop version ..."
# - gulp
# - JEKYLL_ENV=production bundle exec jekyll build --config _config.yml,_config_desktop.yml -d content/
# - echo "=> Packaging desktop version ..."
# - export PATH="$PATH:/root/.local/bin"
# - export AWS_ACCESS_KEY_ID=$(echo "$AWS_ACCESS_KEY_ID")
# - export AWS_SECRET_ACCESS_KEY=$(echo "$AWS_SECRET_ACCESS_KEY")
# - export AWS_DEFAULT_REGION=eu-central-1
# - export PACKAGE_NAME="$(echo $CI_PROJECT_NAME)_$(echo $CI_COMMIT_TAG).tgz"
# - export PACKAGE_NAME_LATEST="$(echo $CI_PROJECT_NAME)_latest.tgz"
# - tar -zcvf "$PACKAGE_NAME" content/
# - cp "$PACKAGE_NAME" "$PACKAGE_NAME_LATEST"
# - aws s3 cp "$PACKAGE_NAME" s3://source-git-pantherx-org/
# - aws s3 cp "$PACKAGE_NAME_LATEST" s3://source-git-pantherx-org/
# only:
# - tags
# tags: [source]