Skip to content
Snippets Groups Projects

CI/CD targeting LTS to publish syllabus

Open William E Warriner requested to merge feat-ci-to-lts into main
1 file
+ 26
27
Compare changes
  • Side-by-side
  • Inline
+ 26
27
build-job:
stage: build
tags:
- rcds
script:
- echo "Hello, $GITLAB_USER_LOGIN"
stages:
- build
- deploy
test-job1:
stage: test
tags:
- rcds
script:
- echo "This job tests something"
build:
stage: build
script:
# We simulate a build phase by manually creating files in a build folder
# An example would be using `yarn build` to build a react project that would create static files in a build or public folder
- mkdir -p public && cp data_science_journal_club_syllabus.html public/syllabus.html
artifacts:
when: on_success
paths:
- build/
expire_in: 20 mins
test-job2:
stage: test
tags:
- rcds
script:
- echo "This job tests something, but takes more time than test-job1"
- echo "Sleeps for 20 seconds"
- sleep 20
deploy-prod:
stage: deploy
tags:
- rcds
script:
- echo "This job deploys something from $CI_COMMIT_BRANCH branch."
environment: production
deploy:
stage: deploy
needs:
- build
image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
script:
- echo "Running deploy"
- aws s3 cp --endpoint-url=https://s3.lts.rc.uab.edu ./public/syllabus.html s3://$S3_BUCKET/ --recursive
- echo "Deployment successful"
Loading