aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 63c6d3d8cff6ed44af1b9c65bd2a4ed704646374 (plain)
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
---
render:
  stage: build
  image:
    name: ghcr.io/typst/typst:0.15.1
    entrypoint: [""]
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
      changes:
        # anything that is an input to the site build
        - "**/*.typ"
        - "global/**/*"
        - "post/**/*"
        - build.sh
  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:
  stage: deploy
  image:
    name: amazon/aws-cli:latest
    entrypoint: [""]
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
      changes:
        # anything that is an input to the site build
        - "**/*.typ"
        - "global/**/*"
        - "post/**/*"
        - build.sh
  needs:
    - render
  script:
    - >
      aws --endpoint-url "$S3_ENDPOINT"
      s3 sync build/ "s3://${S3_BUCKET_NAME}/${S3_UPLOAD_DIR}"
      --delete --exclude "KumarDamaniCV.pdf"