Deploy / deploy (push) Successful in 39s
Add deployed version for services --------- Co-authored-by: Benjamin Labrecque Reviewed-on: #62
62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
name: Add new service
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'feature/add-service-*'
|
|
|
|
env:
|
|
UV_CACHE_DIR: /var/cache/uv
|
|
UV_LINK_MODE: hardlink
|
|
|
|
# TODO: when to deploy to prod? Manual (i.e. the 'Ioc' workflow)?
|
|
jobs:
|
|
deploy:
|
|
runs-on: hla-dev
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Run cli tests
|
|
run: |
|
|
echo $UV_CACHE_DIR
|
|
uv run --directory cli pytest
|
|
|
|
- name: Parse Service Directory Name
|
|
id: parse_branch
|
|
# Uses bash shell parameter elimination to strip 'feature/add-service-' from the front
|
|
run: |
|
|
BRANCH="${{ github.ref_name }}"
|
|
SERVICE_NAME="${BRANCH#feature/add-service-}"
|
|
echo "service_name_lower=$SERVICE_NAME" >> $GITHUB_OUTPUT
|
|
|
|
# The ioc steps read the deployed ioc files on /sls, so the service
|
|
# has to be deployed before its ioc is installed.
|
|
- name: Deploy and Restart Master Service
|
|
run: |
|
|
./.gitea/scripts/deploy-service.sh "master" "dev" true
|
|
|
|
- name: Install Master IOC
|
|
run: |
|
|
./.gitea/scripts/ioc-install.sh "master" "dev"
|
|
|
|
- name: Restart Master IOC
|
|
run: |
|
|
./.gitea/scripts/ioc-restart.sh "master" "dev"
|
|
|
|
- name: Deploy and Restart New Service
|
|
run: |
|
|
SERVICE_NAME=${{ steps.parse_branch.outputs.service_name_lower }}
|
|
./.gitea/scripts/deploy-service.sh "${SERVICE_NAME}" "dev" true
|
|
|
|
- name: Install New IOC
|
|
run: |
|
|
SERVICE_NAME=${{ steps.parse_branch.outputs.service_name_lower }}
|
|
./.gitea/scripts/ioc-install.sh "${SERVICE_NAME}" "dev"
|
|
|
|
- name: Start New IOC
|
|
run: |
|
|
SERVICE_NAME=${{ steps.parse_branch.outputs.service_name_lower }}
|
|
./.gitea/scripts/ioc-start.sh "${SERVICE_NAME}" "dev"
|