mirror of
https://github.com/mrrpnya/lipu-sona.git
synced 2025-02-13 16:44:39 +00:00
36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
# 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:
|
|
- "out"
|
|
|
|
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 out/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.
|
|
before_script:
|
|
- echo "Installing the dependencies..."
|
|
- apk add rsync openssh-client
|
|
- mkdir -p ~/.ssh
|
|
- chmod 700 ~/.ssh
|
|
- eval $(ssh-agent -s)
|
|
- echo "$DEPLOY_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
|
- ssh-add -l
|
|
script:
|
|
- rsync -e "ssh -o StrictHostKeyChecking=no" -ciIlprz out/ deploy@devurandom.xyz:~/out/
|