Verified Commit fdec8fac authored by Adrian Pascu's avatar Adrian Pascu
Browse files

Make project path dyamic in CI

parent e5207a0d
Loading
Loading
Loading
Loading
+3 −2
Changes for .gitlab-ci.yml: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -10,11 +10,12 @@ Build:
    CI_BUILD_REF: $CI_BUILD_REF
    CI_COMMIT_MESSAGE: $CI_COMMIT_MESSAGE
    MESSAGE: $CI_COMMIT_MESSAGE
    CI_PROJECT_ID: $CI_PROJECT_ID
  script:
    # perl is used by commits.sh
    - apk add --no-cache curl perl
    - ./scripts/commits.sh content data/commits
    - curl 'https://gitlab.com/api/v4/projects/hsbxl%2Fsite/repository/commits?private_token='$GITLAB_API_KEY > 'data/changelog/changelog.json'
    - curl --fail https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/repository/commits?private_token=$GITLAB_API_KEY > 'data/changelog/changelog.json'
    - hugo version
    - hugo
  environment:
@@ -30,7 +31,7 @@ Deploy:
  image: debian:trixie
  needs: ["Build"]
  rules:
    - if: '$CI_COMMIT_BRANCH == "master" && $CI_PROJECT_PATH == "hsbxl/site"'
    - if: '$CI_COMMIT_BRANCH == "master" && $PRIVKEY'
  script:
    - apt-get update
    - apt-get install openssh-client tree -y