Skip to content
Snippets Groups Projects
Commit 141b59ae authored by Kwangjin Lee's avatar Kwangjin Lee
Browse files

Update .gitlab-ci.yml file

parent 1e0ac761
No related branches found
No related tags found
1 merge request!367test publish build
Pipeline #245580 passed
...@@ -19,39 +19,30 @@ before_script: ...@@ -19,39 +19,30 @@ before_script:
- source venv/bin/activate - source venv/bin/activate
- pip install -r requirements.txt - pip install -r requirements.txt
build-draft: build-book:
stage: build stage: build
script: script:
- echo "Building draft version" - |
- teachbooks build book/ > >(tee stdout.log) 2> >(tee stderr.log >&2) if [ "$CI_COMMIT_BRANCH" == "publish" ]; then
artifacts: echo "Building production version"
paths: teachbooks build --publish book/ > >(tee stdout.log) 2> >(tee stderr.log >&2)
- book/_build/html else
- stdout.log echo "Building draft version"
- stderr.log teachbooks build book/ > >(tee stdout.log) 2> >(tee stderr.log >&2)
rules: fi
- if: $CI_COMMIT_BRANCH == "main"
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"
when: always
build-production:
stage: build
script:
- echo "Building production version"
- teachbooks build --publish book/ > >(tee stdout.log) 2> >(tee stderr.log >&2)
artifacts: artifacts:
paths: paths:
- book/_build/html - book/_build/html
- stdout.log - stdout.log
- stderr.log - stderr.log
rules: rules:
- if: $CI_COMMIT_BRANCH == "publish" - if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "publish"
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "publish" - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "publish"
when: always when: always
deploy-draft: deploy-draft:
stage: deploy stage: deploy
needs: ["build-draft"] needs: ["build-book"]
script: script:
- | - |
curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy-draft \ curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy-draft \
...@@ -69,12 +60,10 @@ deploy-draft: ...@@ -69,12 +60,10 @@ deploy-draft:
url: https://mude.citg.tudelft.nl/2024/book/draft url: https://mude.citg.tudelft.nl/2024/book/draft
rules: rules:
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"
when: always
deploy-production: deploy-production:
stage: deploy stage: deploy
needs: ["build-production"] needs: ["build-book"]
script: script:
- | - |
curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy \ curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy \
...@@ -91,6 +80,4 @@ deploy-production: ...@@ -91,6 +80,4 @@ deploy-production:
name: production name: production
url: https://mude.citg.tudelft.nl/2024/book url: https://mude.citg.tudelft.nl/2024/book
rules: rules:
- if: $CI_COMMIT_BRANCH == "publish" - if: $CI_COMMIT_BRANCH == "publish"
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "publish" \ No newline at end of file
when: always
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment