-
Notifications
You must be signed in to change notification settings - Fork 7
96 lines (88 loc) · 4.41 KB
/
deploy-production.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Deploy sites (production)
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
version:
runs-on: ubuntu-latest
steps:
- id: tag_version
run: |
REF=$(echo $GITHUB_REF | cut -d / -f 3)
[[ "$GITHUB_REF" =~ ^refs/tags.*$ ]] && VERSION="$REF" || VERSION="${REF}-${GITHUB_SHA::7}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
outputs:
version: ${{ steps.tag_version.outputs.version }}
notify-start:
needs: [version]
uses: parameter1/actions/.github/workflows/notify-start.yml@main
secrets: inherit
with:
version: ${{ needs.version.outputs.version }}
post-deploy-failure:
if: failure()
needs: [notify-start, build-sites, deploy-sites]
uses: parameter1/actions/.github/workflows/notify-fail.yml@main
secrets: inherit
with:
slack-thread: ${{ needs.notify-start.outputs.slack-thread }}
post-deploy-complete:
if: success()
needs: [notify-start, build-sites, deploy-sites]
uses: parameter1/actions/.github/workflows/notify-complete.yml@main
secrets: inherit
with:
slack-thread: ${{ needs.notify-start.outputs.slack-thread }}
######################
# Add websites here! #
######################
build-sites:
needs: [version]
uses: parameter1/actions/.github/workflows/website-build-push-test.yml@main
strategy:
matrix:
###############################################
#v# Make sure this matches the site matrix! #v#
###############################################
site:
- { dir: ccnewsnow.com, stack: virgon, id: 60c28bc3d28860bc334ebcb2, account: diverse, tenant: diverse_all, rancher_label: cox-matthews-associates-ccnewsnow.com }
- { dir: diverseeducation.com, stack: virgon, id: 60c281c6d28860bc33464ae0, account: diverse, tenant: diverse_all, rancher_label: cox-matthews-associates-diverseeducation.com }
- { dir: diversemilitary.net, stack: virgon, id: 60c28c0dd28860bc334ed723, account: diverse, tenant: diverse_all, rancher_label: cox-matthews-associates-diversemilitary.net }
- { dir: divhealth.net, stack: virgon, id: 60c28c4bd28860bc334f485d, account: diverse, tenant: diverse_all, rancher_label: cox-matthews-associates-divhealth.net }
###############################################
#^# Make sure this matches the site matrix! #^#
###############################################
with:
ecr_registry: ${{ vars.AWS_ECR_REGISTRY }}
docker_image: ${{ vars.AWS_ECR_REGISTRY }}/base-cms-websites:${{ matrix.site.account }}-${{ matrix.site.dir }}-${{ needs.version.outputs.version }}
site_host: ${{ matrix.site.dir }}
push: true
secrets: inherit
deploy-sites:
needs: [version, build-sites]
uses: parameter1/actions/.github/workflows/website-deploy-production.yml@main
strategy:
matrix:
###############################################
#v# Make sure this matches the site matrix! #v#
###############################################
site:
- { dir: ccnewsnow.com, stack: virgon, id: 60c28bc3d28860bc334ebcb2, account: diverse, tenant: diverse_all, rancher_label: cox-matthews-associates-ccnewsnow.com }
- { dir: diverseeducation.com, stack: virgon, id: 60c281c6d28860bc33464ae0, account: diverse, tenant: diverse_all, rancher_label: cox-matthews-associates-diverseeducation.com }
- { dir: diversemilitary.net, stack: virgon, id: 60c28c0dd28860bc334ed723, account: diverse, tenant: diverse_all, rancher_label: cox-matthews-associates-diversemilitary.net }
- { dir: divhealth.net, stack: virgon, id: 60c28c4bd28860bc334f485d, account: diverse, tenant: diverse_all, rancher_label: cox-matthews-associates-divhealth.net }
###############################################
#^# Make sure this matches the site matrix! #^#
###############################################
with:
ecr_registry: ${{ vars.AWS_ECR_REGISTRY }}
docker_image: ${{ vars.AWS_ECR_REGISTRY }}/base-cms-websites:${{ matrix.site.account }}-${{ matrix.site.dir }}-${{ needs.version.outputs.version }}
infra_stack: ${{ matrix.site.stack }}
rancher_label_key: basecms-website
rancher_label_val: ${{ matrix.site.rancher_label }}
site_dir: ${{ matrix.site.dir }}
site_id: ${{ matrix.site.id }}
tenant: ${{ matrix.site.tenant }}
version: ${{ needs.version.outputs.version }}
secrets: inherit