aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml53
1 files changed, 32 insertions, 21 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 27dcf1e..d994137 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,24 +1,35 @@
-image: 'python:3-slim-buster'
-
-before_script:
- - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- - eval $(ssh-agent -s)
- - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- - mkdir -p ~/.ssh
- - chmod 700 ~/.ssh
- - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'
-
-stages:
- - deploy
+---
+render:
+ stage: build
+ image:
+ name: ghcr.io/typst/typst:v0.15.1
+ entrypoint: [""]
+ rules:
+ - if: $CI_COMMIT_BRANCH == "main"
+ changes:
+ - "**/*.typ"
+ script:
+ - >
+ printf '{ "date": "%s", "link": "%s" }\n'
+ "$(date '+%B %d, %Y' | sed 's/ 0/ /')" "$CI_JOB_URL" > ci.json
+ - ./build.sh
+ artifacts:
+ paths:
+ - build/
-deploy-job:
+deploy:
stage: deploy
+ image:
+ name: amazon/aws-cli:latest
+ entrypoint: [""]
+ rules:
+ - if: $CI_COMMIT_BRANCH == "main"
+ changes:
+ - "**/*.typ"
+ needs:
+ - render
script:
- - apt update -y && apt install -y git make sshpass
- - echo "Deploying application..."
- - git clone --branch master --depth 1 https://gitlab.com/kdam0/vps.git
- - cd vps
- - echo $VAULT_PASS > vaultid
- - make install
- - make run file=playbooks/deploy.yaml tags="websites" args="-v"
- - echo "Application successfully deployed!"
+ - >
+ aws --endpoint-url "$S3_ENDPOINT"
+ s3 sync build/ "s3://${S3_BUCKET_NAME}/${S3_UPLOAD_DIR}"
+ --delete --exclude "KumarDamaniCV.pdf"