-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (70 loc) · 2.59 KB
/
cloudgov-deploy-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Deploy App
on:
workflow_call:
jobs:
updateApp:
name: Update App
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set enviornment
run: |
BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)
COMPOSER_DEV=1
case ${BRANCH} in
develop)
CF_SPACE="dev"
DRUPAL_MEMORY=${{ vars.DEVELOP_CMS_MEMORY }}
DRUPAL_INSTANCES=${{ vars.DEVELOP_INSTANCES }}
;;
main)
CF_SPACE="prod"
COMPOSER_DEV=0
DRUPAL_MEMORY=${{ vars.MAIN_CMS_MEMORY }}
DRUPAL_INSTANCES=${{ vars.MAIN_INSTANCES }}
;;
stage)
CF_SPACE="staging"
COMPOSER_DEV=0
DRUPAL_MEMORY=${{ vars.STAGE_CMS_MEMORY }}
DRUPAL_INSTANCES=${{ vars.STAGE_INSTANCES }}
;;
esac
echo "APP_NAME=drupal" | tee -a $GITHUB_ENV
echo "BRANCH=${BRANCH}" | tee -a $GITHUB_ENV
echo "BUILDPACK_PORT=${{ vars.BUILDPACK_PORT }}" | tee -a $GITHUB_ENV
echo "CF_SPACE=${CF_SPACE}" | tee -a $GITHUB_ENV
echo "COMPOSER_DEV=${COMPOSER_DEV}" | tee -a $GITHUB_ENV
echo "DRUPAL_INSTANCES=${DRUPAL_INSTANCES}" | tee -a $GITHUB_ENV
echo "DRUPAL_MEMORY=${DRUPAL_MEMORY}" | tee -a $GITHUB_ENV
echo "HASH_SALT=${{ secrets.HASH_SALT }}" | tee -a $GITHUB_ENV
echo "WAF_NAME=waf"| tee -a $GITHUB_ENV
if [ "${COMPOSER_DEV}" = "1" ]; then
sed -i 's/--no-dev //' .bp-config/options.json || exit 0
fi
- name: Set repo name
run: echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV
- name: Install basic dependancies
run: ./scripts/pipeline/deb-basic-deps.sh
- name: Install Cloudfoundry CLI
run: ./scripts/pipeline/deb-cf-install.sh
- name: Cloud.gov login
env:
CF_USER: "${{ secrets.CF_USER }}"
CF_PASSWORD: "${{ secrets.CF_PASSWORD }}"
CF_ORG: "${{ secrets.CF_ORG }}"
PROJECT: "${{ secrets.PROJECT }}"
run: |
source ./scripts/pipeline/cloud-gov-login.sh
cf target -s "${CF_SPACE}" >/dev/null 2>&1
- name: Build theme
run: ./orch/build_node.sh
- name: Deploy App
env:
PROJECT: "${{ secrets.PROJECT }}"
run: source ./scripts/pipeline/cloud-gov-deploy.sh
- name: Post Deploy
env:
PROJECT: "${{ secrets.PROJECT }}"
run: source ./scripts/pipeline/cloud-gov-post-deploy.sh