-
Notifications
You must be signed in to change notification settings - Fork 42
113 lines (105 loc) · 3.69 KB
/
deploy.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
101
102
103
104
105
106
107
108
109
110
111
112
113
name: PrestaShop 1.7 - Deployment
on:
pull_request:
types: [opened, reopened, synchronize, edited, labeled]
push:
tags:
- "v7.*"
branches:
- "prestashop/1.7.x"
env:
ZIP_NAME: ${{ github.event.repository.name }}
jobs:
build:
name: Build dependencies & create artifact
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
strategy:
fail-fast: false
matrix:
env:
- upper: INTEGRATION
lower: integration
triggered: ${{ contains(github.event.pull_request.labels.*.name, 'integration deployment') }}
- upper: PREPRODUCTION
lower: preproduction
triggered: ${{ contains(github.event.pull_request.labels.*.name, 'preproduction deployment') }}
- upper: PRODUCTION
lower: production
triggered: ${{ github.event_name == 'push' }}
steps:
- name: Test
run: |
echo 'env : ' $env
echo 'format : ' $format
echo 'Provider : ' $PROVIDER
echo 'SA : ' $SA
echo 'GCP Project : ' $GCP_PROJECT
echo 'Test : ' $TEST
env:
TEST: test
env: ${{ matrix.env.upper }}
format: ${{ format('WI_PROVIDER_V2_{0}', matrix.env.upper) }}
PROVIDER: ${{ secrets[format('WI_PROVIDER_V2_{0}', matrix.env.upper)] }}
SA: ${{ secrets[format('WI_SA_V2_{0}', matrix.env.upper)] }}
GCP_PROJECT: ${{ secrets[format('GCP_PROJECT_{0}', matrix.env.upper)] }}
build-matrix:
name: ${{ matrix.env.upper }} - Build
strategy:
fail-fast: false
matrix:
env:
- upper: INTEGRATION
lower: integration
triggered: ${{ contains(github.event.pull_request.labels.*.name, 'integration deployment') }}
- upper: PREPRODUCTION
lower: preproduction
triggered: ${{ contains(github.event.pull_request.labels.*.name, 'preproduction deployment') }}
- upper: PRODUCTION
lower: production
triggered: ${{ github.event_name == 'push' }}
uses: ./.github/workflows/build.yml
with:
env-upper: ${{ matrix.env.upper }}
env-lower: ${{ matrix.env.lower }}
triggered: ${{ matrix.env.triggered }}
secrets: inherit
push-to-bucket-matrix:
name: ${{ matrix.env.upper }} - Push to GCP bucket storage
needs: [build-matrix]
strategy:
fail-fast: false
matrix:
env:
- lower: integration
upper: INTEGRATION
triggered: ${{ contains(github.event.pull_request.labels.*.name, 'integration deployment') }}
- lower: preproduction
upper: PREPRODUCTION
triggered: ${{ contains(github.event.pull_request.labels.*.name, 'preproduction deployment') }}
uses: ./.github/workflows/push-to-bucket.yml
with:
env-upper: ${{ matrix.env.upper }}
env-lower: ${{ matrix.env.lower }}
triggered: ${{ matrix.env.triggered }}
zip-name: ${{ github.event.repository.name }}-${{ matrix.env.lower }}-pr${{ github.event.number }}
secrets: inherit
push-to-repository:
name: PRODUCTION - Push to GitHub repository
needs: [build-matrix]
uses: ./.github/workflows/push-to-repository.yml
with:
triggered: ${{ github.event_name == 'push' }}
repository-name: ${{ github.event.repository.name }}
secrets: inherit
update-release-draft:
name: PRODUCTION - Update release draft
needs: [push-to-repository]
uses: ./.github/workflows/update-release-draft.yml
with:
triggered: ${{ github.event_name == 'push' }}
repository-name: ${{ github.event.repository.name }}
secrets: inherit