-
Notifications
You must be signed in to change notification settings - Fork 18
51 lines (48 loc) · 1.77 KB
/
docker.yaml
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
name: Staging - Helmfile Diff
on:
- pull_request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HELMFILE_FILE_PATH: ${{ github.workspace }}/helmfile
STAGING_AWS_ACCOUNT: ${{ secrets.STAGING_AWS_ACCOUNT }}
jobs:
helmfile-diff:
runs-on: github-arc-ss-api-dev
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
id: awsconfig
with:
aws-access-key-id: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
aws-region: ca-central-1
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
# Fetches entire history, so we can analyze commits since last tag
fetch-depth: 0
- name: Setup helmfile
uses: mamezou-tech/[email protected]
with:
install-kubectl: yes
install-helm: yes
- name: Configure kubeconfig
run: |
aws eks update-kubeconfig --name notification-canada-ca-staging-eks-cluster
kubectl config rename-context arn:aws:eks:ca-central-1:$STAGING_AWS_ACCOUNT:cluster/notification-canada-ca-staging-eks-cluster staging
- name: Load EnvVars
run: |
./helmfile/getContext.sh true
- name: Helmfile Diff
id: helmfile_diff
run: |
echo 'var<<EOF' >> $GITHUB_OUTPUT
helmfile --environment staging diff >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Helmfile Diff Comment
uses: mshick/add-pr-comment@v2
with:
message: |
```shell
${{join(steps.helmfile_diff.outputs.*, '\n')}}
```