forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathci-publish-cloud-helm-charts.yaml
More file actions
139 lines (127 loc) · 5.79 KB
/
ci-publish-cloud-helm-charts.yaml
File metadata and controls
139 lines (127 loc) · 5.79 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
defaults:
run:
shell: bash
jobs:
publish-aws:
if: ${{github.repository == 'liferay/liferay-portal'}}
needs: publish-default
secrets: inherit
uses: ./.github/workflows/ci-reusable-publish-helm-chart-to-gar.yaml
with:
chart_name: liferay-aws
registry: us-central1-docker.pkg.dev/liferay-artifact-registry/liferay-helm-chart
working_directory: ./cloud/helm/aws
publish-aws-infrastructure:
if: ${{github.repository == 'liferay/liferay-portal'}}
secrets: inherit
uses: ./.github/workflows/ci-reusable-publish-helm-chart-to-gar.yaml
with:
chart_name: liferay-aws-infrastructure
registry: us-central1-docker.pkg.dev/external-assets-prd/liferay-helm-chart
working_directory: ./cloud/helm/aws-infrastructure
publish-aws-infrastructure-provider:
if: ${{github.repository == 'liferay/liferay-portal'}}
secrets: inherit
uses: ./.github/workflows/ci-reusable-publish-helm-chart-to-gar.yaml
with:
chart_name: liferay-aws-infrastructure-provider
registry: us-central1-docker.pkg.dev/external-assets-prd/liferay-helm-chart
working_directory: ./cloud/helm/aws-infrastructure-provider
publish-aws-marketplace:
env:
ECR_REGISTRY: 709825985650.dkr.ecr.us-east-1.amazonaws.com
if: ${{github.repository == 'liferay/liferay-portal'}}
needs: publish-aws
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v5.1.0
with:
aws-region: us-east-1
role-session-name: GitHubActions
role-to-assume: arn:aws:iam::831926597587:role/GitHubActionsRole
- name: Log in to ECR
run: |
aws ecr get-login-password --region us-east-1 \
| helm registry login "${ECR_REGISTRY}" \
--password-stdin \
--username AWS
- name: Checkout code
uses: actions/checkout@v4
- env:
GITHUB_TOKEN: ${{github.token}}
id: verify_version
name: Verify Helm chart version
run: |
set -e
CHART_VERSION=$(cat ./Chart.yaml | yq .version)
echo "Verifying Helm chart version ${CHART_VERSION}."
if ! helm show readme "oci://${ECR_REGISTRY}/liferay/liferay-aws-marketplace:${CHART_VERSION}" >/dev/null 2>&1
then
echo "Verified Helm Chart version ${CHART_VERSION}."
echo "CHART_VERSION=${CHART_VERSION}" >> ${GITHUB_ENV}
echo "should_publish=true" >> ${GITHUB_OUTPUT}
else
echo "Chart version ${CHART_VERSION} already exists. Skipping publish."
fi
working-directory: ./cloud/helm/aws-marketplace
- if: ${{steps.verify_version.outputs.should_publish == 'true'}}
name: Package and push Helm chart
run: |
set -e
DIST_DIR="${{runner.temp}}/aws-marketplace/dist"
rm -fr "${DIST_DIR}"
mkdir --parents "${DIST_DIR}"
helm dependency update
helm package . \
--destination "${DIST_DIR}" \
--version "${CHART_VERSION}"
for file_name in "${DIST_DIR}"/*.tgz
do
echo "Pushing ${file_name}."
helm push "${file_name}" "oci://${ECR_REGISTRY}/liferay"
done
working-directory: ./cloud/helm/aws-marketplace
publish-default:
if: ${{github.repository == 'liferay/liferay-portal'}}
secrets: inherit
uses: ./.github/workflows/ci-reusable-publish-helm-chart-to-gar.yaml
with:
chart_name: liferay-default
registry: us-central1-docker.pkg.dev/liferay-artifact-registry/liferay-helm-chart
working_directory: ./cloud/helm/default
publish-gcp:
if: ${{github.repository == 'liferay/liferay-portal'}}
needs: publish-default
secrets: inherit
uses: ./.github/workflows/ci-reusable-publish-helm-chart-to-gar.yaml
with:
chart_name: liferay-gcp
registry: us-central1-docker.pkg.dev/liferay-artifact-registry/liferay-helm-chart
working_directory: ./cloud/helm/gcp
publish-gcp-infrastructure:
if: ${{github.repository == 'liferay/liferay-portal'}}
secrets: inherit
uses: ./.github/workflows/ci-reusable-publish-helm-chart-to-gar.yaml
with:
chart_name: liferay-gcp-infrastructure
registry: us-central1-docker.pkg.dev/external-assets-prd/liferay-helm-chart
working_directory: ./cloud/helm/gcp-infrastructure
publish-gcp-infrastructure-provider:
if: ${{github.repository == 'liferay/liferay-portal'}}
secrets: inherit
uses: ./.github/workflows/ci-reusable-publish-helm-chart-to-gar.yaml
with:
chart_name: liferay-gcp-infrastructure-provider
registry: us-central1-docker.pkg.dev/external-assets-prd/liferay-helm-chart
working_directory: ./cloud/helm/gcp-infrastructure-provider
on:
push:
branches:
- master
paths:
- .github/workflows/ci-publish-cloud-helm-charts.yaml
- .github/workflows/ci-reusable-publish-helm-chart-to-gar.yaml
- cloud/helm/**
permissions:
id-token: write