Fix deployment

This commit is contained in:
Mangiang 2021-10-27 21:51:41 -04:00
parent e9685f40f7
commit 973ad758f5
No known key found for this signature in database
GPG Key ID: DAE9B92A692CD55C

View File

@ -11,7 +11,10 @@ environment:
trigger: trigger:
event: event:
- push - push
- promote branch:
- master
- main
- development
steps: steps:
- name: fetch and update submodules to the latest commit - name: fetch and update submodules to the latest commit
@ -34,6 +37,11 @@ steps:
- mv ./items/frontend/.env.example ./items/frontend/.env - mv ./items/frontend/.env.example ./items/frontend/.env
- sed -i 's/{{ DEPLOY_HOST }}/'"$DEPLOY_HOST"'/g' ./.ansible-items/inventory - sed -i 's/{{ DEPLOY_HOST }}/'"$DEPLOY_HOST"'/g' ./.ansible-items/inventory
- sed -i 's/{{ DEPLOYMENT_USER }}/'"$DEPLOYMENT_USER"'/g' ./.ansible-items/inventory - sed -i 's/{{ DEPLOYMENT_USER }}/'"$DEPLOYMENT_USER"'/g' ./.ansible-items/inventory
when:
branch:
- master
- main
- development
- name: build frontend - name: build frontend
image: node:lts-alpine3.14 image: node:lts-alpine3.14
@ -46,6 +54,11 @@ steps:
- rm -rf ./items/api/public/static/* - rm -rf ./items/api/public/static/*
- mv ./items/frontend/build/* ./items/api/public - mv ./items/frontend/build/* ./items/api/public
- rm ./items/api/public/index.html - rm ./items/api/public/index.html
when:
branch:
- master
- main
- development
- name: check ansible syntax - name: check ansible syntax
image: plugins/ansible:3 image: plugins/ansible:3
@ -70,7 +83,6 @@ steps:
DEPLOYMENT_USER: DEPLOYMENT_USER:
from_secret: deploy_username from_secret: deploy_username
when: when:
event: branch:
- promote - master
target: - main
- production