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:
- source venv/bin/activate
- pip install -r requirements.txt
build-draft:
build-book:
stage: build
script:
- echo "Building draft version"
- teachbooks build book/ > >(tee stdout.log) 2> >(tee stderr.log >&2)
artifacts:
paths:
- book/_build/html
- stdout.log
- stderr.log
rules:
- 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)
- |
if [ "$CI_COMMIT_BRANCH" == "publish" ]; then
echo "Building production version"
teachbooks build --publish book/ > >(tee stdout.log) 2> >(tee stderr.log >&2)
else
echo "Building draft version"
teachbooks build book/ > >(tee stdout.log) 2> >(tee stderr.log >&2)
fi
artifacts:
paths:
- book/_build/html
- stdout.log
- stderr.log
rules:
- if: $CI_COMMIT_BRANCH == "publish"
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "publish"
- if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "publish"
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "publish"
when: always
deploy-draft:
stage: deploy
needs: ["build-draft"]
needs: ["build-book"]
script:
- |
curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy-draft \
......@@ -69,12 +60,10 @@ deploy-draft:
url: https://mude.citg.tudelft.nl/2024/book/draft
rules:
- if: $CI_COMMIT_BRANCH == "main"
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"
when: always
deploy-production:
stage: deploy
needs: ["build-production"]
needs: ["build-book"]
script:
- |
curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy \
......@@ -91,6 +80,4 @@ deploy-production:
name: production
url: https://mude.citg.tudelft.nl/2024/book
rules:
- if: $CI_COMMIT_BRANCH == "publish"
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "publish"
when: always
\ No newline at end of file
- if: $CI_COMMIT_BRANCH == "publish"
\ 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