features: cicd use prod/dev
This commit is contained in:
@@ -2,8 +2,13 @@ name: Deploy service MASTER
|
||||
|
||||
on:
|
||||
push:
|
||||
# TODO: if someone tags 'prod' to a (broken) feature branch
|
||||
# this still triggers (and deploys to prod).
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'prod'
|
||||
- 'v*'
|
||||
# paths:
|
||||
# - 'services/000-master/**'
|
||||
|
||||
@@ -15,17 +20,19 @@ jobs:
|
||||
working-directory: ./services
|
||||
|
||||
env:
|
||||
# TODO: prod/dev
|
||||
SVC_CURRRENT_DIR: /sls/bd/hla/dev/services/000-master/current
|
||||
# commit tagged ? yes->prod : no->dev
|
||||
AGEBD_ENV: ${{ github.ref_type == 'tag' && 'prod' || 'dev' }}
|
||||
SVC_CURRRENT_DIR: /sls/bd/hla/${{ github.ref_type == 'tag' && 'prod' || 'dev' }}/services/000-master/current
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Copy files
|
||||
- name: Copy files and replace {{ agebd_env }} with dev or prod
|
||||
run: |
|
||||
mkdir -p ${SVC_CURRRENT_DIR}
|
||||
cp -r 000-master/* ${SVC_CURRRENT_DIR}
|
||||
sed -i 's/{{ agebd_env }}/dev/g' ${SVC_CURRRENT_DIR}/systemd/AGEBD-SERVICE-MASTER.service
|
||||
|
||||
- name: Create Python venv
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user