-
Notifications
You must be signed in to change notification settings - Fork 13
100 lines (92 loc) · 4.94 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
97
98
99
100
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: cpgnext.com, stack: tauron, id: 646d197711878ad52db7ff2a, account: pmmi, tenant: pmmi_all, rancher_label: pmmi-media-group-cpgnext.com }
- { dir: healthcarepackaging.com, stack: tauron, id: 5d88cef7f175132c008b456f, account: pmmi, tenant: pmmi_all, rancher_label: pmmi-media-group-healthcarepackaging.com }
- { dir: mundopmmi.com, stack: tauron, id: 5d0a748572c1aa35008b4567, account: pmmi, tenant: pmmi_mundo, rancher_label: pmmi-media-group-mundopmmi.com }
- { dir: oemmagazine.org, stack: tauron, id: 5d88cf05f175132c008b4573, account: pmmi, tenant: pmmi_all, rancher_label: pmmi-media-group-oemmagazine.org }
- { dir: packworld.com, stack: tauron, id: 5d88cedef175132c008b456b, account: pmmi, tenant: pmmi_all, rancher_label: pmmi-media-group-packworld.com }
- { dir: profoodworld.com, stack: tauron, id: 5d88cf1af175132c008b4577, account: pmmi, tenant: pmmi_all, rancher_label: pmmi-media-group-profoodworld.com }
###############################################
#^# 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: cpgnext.com, stack: tauron, id: 646d197711878ad52db7ff2a, account: pmmi, tenant: pmmi_all, rancher_label: pmmi-media-group-cpgnext.com }
- { dir: healthcarepackaging.com, stack: tauron, id: 5d88cef7f175132c008b456f, account: pmmi, tenant: pmmi_all, rancher_label: pmmi-media-group-healthcarepackaging.com }
- { dir: mundopmmi.com, stack: tauron, id: 5d0a748572c1aa35008b4567, account: pmmi, tenant: pmmi_mundo, rancher_label: pmmi-media-group-mundopmmi.com }
- { dir: oemmagazine.org, stack: tauron, id: 5d88cf05f175132c008b4573, account: pmmi, tenant: pmmi_all, rancher_label: pmmi-media-group-oemmagazine.org }
- { dir: packworld.com, stack: tauron, id: 5d88cedef175132c008b456b, account: pmmi, tenant: pmmi_all, rancher_label: pmmi-media-group-packworld.com }
- { dir: profoodworld.com, stack: tauron, id: 5d88cf1af175132c008b4577, account: pmmi, tenant: pmmi_all, rancher_label: pmmi-media-group-profoodworld.com }
###############################################
#^# 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