forked from pona-la/lipu-sona
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
36 lines (32 loc) · 1.23 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
# The base image is Alpine Linux, because it's small and awesome
image: alpine:latest
stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy
build-job: # This job runs in the build stage, which runs first.
stage: build
before_script:
- echo "Installing the dependencies..."
- apk add discount make bash perl gcc
script:
- make THEME=discount-theme
artifacts:
paths:
- "public"
unit-test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
script:
- test $(stat -c %s public/index.html) -gt 0 #test that the index file exists
deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
only:
- main #Do not run the deploy pipeline on merge requests
before_script:
- if [ -z "$DEPLOY_PRIVATE_KEY" ]; then echo "Can't deploy without a private key."; exit 1; fi
- echo "Installing the dependencies..."
- apk add bash curl jq
- curl https://gitlab.com/dev_urandom/neocities-uploader/-/raw/main/upload.sh?inline=false > upload.sh
- chmod +x upload.sh
script:
- ./upload.sh