|
1 | 1 | name: Helm publish |
2 | 2 |
|
3 | 3 | on: |
| 4 | + # This job is manually dispatched for now, since we do not have image build fully automated yet. |
4 | 5 | workflow_dispatch: |
5 | 6 | inputs: |
6 | 7 | tag: |
7 | | - description: "Tag referencing commit to create release from" |
| 8 | + description: "Release tag (e.g. v2.0.0)" |
| 9 | + required: true |
| 10 | + dry-run: |
| 11 | + description: "Skip publishing Helm chart" |
| 12 | + type: boolean |
8 | 13 | required: true |
| 14 | + default: true |
9 | 15 |
|
10 | 16 | jobs: |
11 | | - # This job is manually dispatched for now, since we do not have image build fully automated yet. |
12 | | - helm: |
| 17 | + verify-helm-chart: |
13 | 18 | runs-on: ubuntu-latest |
14 | 19 | permissions: |
15 | | - contents: write |
16 | | - # Ensure only the latest version of the workflow can run, as this is global for the project |
17 | | - if: ${{ github.ref == 'refs/heads/main' }} |
| 20 | + id-token: write |
| 21 | + environment: "trusted" |
18 | 22 | steps: |
19 | 23 | - name: Checkout tag |
20 | 24 | uses: actions/checkout@v6 |
|
29 | 33 | sparse-checkout: | |
30 | 34 | scripts/verify-helm-images.sh |
31 | 35 | sparse-checkout-cone-mode: false |
32 | | - - name: Configure Git |
33 | | - run: | |
34 | | - git config user.name "$GITHUB_ACTOR" |
35 | | - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" |
36 | 36 | - name: Install crane |
37 | 37 | run: | |
38 | 38 | cd /tmp |
|
41 | 41 | sudo mv crane /usr/local/bin/crane |
42 | 42 | sudo chmod +x /usr/local/bin/crane |
43 | 43 | crane version |
| 44 | + - name: Configure AWS Credentials |
| 45 | + uses: aws-actions/configure-aws-credentials@v6 |
| 46 | + with: |
| 47 | + role-to-assume: ${{ vars.IAM_ROLE }} |
| 48 | + aws-region: ${{ vars.AWS_REGION }} |
| 49 | + inline-session-policy: >- |
| 50 | + { |
| 51 | + "Version": "2012-10-17", |
| 52 | + "Statement": [ |
| 53 | + { |
| 54 | + "Sid":"AllowECRAuth", |
| 55 | + "Effect":"Allow", |
| 56 | + "Action":"ecr:GetAuthorizationToken", |
| 57 | + "Resource":"*" |
| 58 | + }, |
| 59 | + { |
| 60 | + "Sid":"AllowECRRead", |
| 61 | + "Effect": "Allow", |
| 62 | + "Action": "ecr:BatchGetImage", |
| 63 | + "Resource": "arn:aws:ecr:us-east-1:602401143452:repository/eks/*" |
| 64 | + } |
| 65 | + ] |
| 66 | + } |
44 | 67 | - name: Verify all images exist before publishing |
45 | 68 | run: ./main-branch/scripts/verify-helm-images.sh |
| 69 | + publish-helm-chart: |
| 70 | + runs-on: ubuntu-latest |
| 71 | + permissions: |
| 72 | + contents: write |
| 73 | + needs: [verify-helm-chart] |
| 74 | + # Ensure only the latest version of this job on main can run for publishing, as this is global for the project |
| 75 | + if: ${{ github.ref == 'refs/heads/main' && !inputs.dry-run }} |
| 76 | + steps: |
| 77 | + - name: Checkout tag |
| 78 | + uses: actions/checkout@v6 |
| 79 | + with: |
| 80 | + ref: ${{ inputs.tag }} |
| 81 | + fetch-depth: 0 |
| 82 | + - name: Configure Git |
| 83 | + run: | |
| 84 | + git config user.name "$GITHUB_ACTOR" |
| 85 | + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" |
46 | 86 | - name: Run chart-releaser |
47 | 87 | uses: helm/chart-releaser-action@v1.7.0 |
48 | 88 | env: |
|
0 commit comments