|
6 | 6 | tags:
|
7 | 7 | - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
|
8 | 8 |
|
9 |
| -# This workflow copies image from testing private repository to: |
10 |
| -# 1) private ARS source repository |
11 |
| -# 2) public repository |
12 |
| -env: |
13 |
| - GIT_TAG: ${{ github.ref_name }} |
14 |
| - TAG_PASSED: "test_passed_${{ github.sha }}" |
15 |
| - IMAGE_NAME: "s3-csi-driver" |
16 |
| - PUBLIC_REGISTRY: ${{ vars.PUBLIC_REGISTRY }} |
17 |
| - ARS_REGISTRY: ${{ vars.ARS_REGISTRY }} |
18 | 9 | jobs:
|
19 | 10 | build:
|
20 | 11 | # this is to prevent the job to run at forked projects
|
|
25 | 16 | id-token: write
|
26 | 17 | contents: write
|
27 | 18 | steps:
|
28 |
| - - name: Checkout |
29 |
| - uses: actions/checkout@v4 |
30 |
| - - name: Set up Docker Buildx |
31 |
| - id: buildx |
32 |
| - uses: docker/setup-buildx-action@v1 |
33 |
| - - name: Set up crane |
34 |
| - |
35 |
| - |
36 |
| - - name: Configure AWS Credentials from CI Trusted account |
37 |
| - uses: aws-actions/configure-aws-credentials@v4 |
38 |
| - with: |
39 |
| - role-to-assume: ${{ vars.CI_TRUSTED_IAM_ROLE }} |
40 |
| - aws-region: ${{ vars.AWS_CI_TRUSTED_REGION }} |
41 |
| - - name: Login to Amazon ECR (trusted) |
42 |
| - id: login-ecr-trusted |
43 |
| - uses: aws-actions/amazon-ecr-login@v1 |
44 |
| - |
45 |
| - - name: Configure AWS Credentials from Prod account |
46 |
| - uses: aws-actions/configure-aws-credentials@v4 |
47 |
| - with: |
48 |
| - role-to-assume: ${{ vars.PROD_IAM_IMAGE_ROLE }} |
49 |
| - aws-region: ${{ vars.AWS_PROD_ECR_REGION }} |
50 |
| - - name: Login to Amazon ECR (prod) |
51 |
| - id: login-ecr-prod |
52 |
| - uses: aws-actions/amazon-ecr-login@v1 |
53 |
| - |
54 |
| - - name: Configure AWS Credentials from Prod account (for ECR public) |
55 |
| - if: ${{ env.PUBLIC_REGISTRY != '' }} |
56 |
| - uses: aws-actions/configure-aws-credentials@v4 |
57 |
| - with: |
58 |
| - role-to-assume: ${{ vars.PROD_IAM_IMAGE_ROLE }} |
59 |
| - aws-region: us-east-1 |
60 |
| - - name: Login to Amazon ECR (public) |
61 |
| - if: ${{ env.PUBLIC_REGISTRY != '' }} |
62 |
| - id: login-ecr-public |
63 |
| - uses: aws-actions/amazon-ecr-login@v1 |
64 |
| - with: |
65 |
| - registry-type: public |
66 |
| - |
67 |
| - - name: Promote image |
68 |
| - env: |
69 |
| - SOURCE_REGISTRY: ${{ steps.login-ecr-trusted.outputs.registry }} |
70 |
| - run: | |
71 |
| - crane copy ${SOURCE_REGISTRY}/${IMAGE_NAME}:${TAG_PASSED} ${ARS_REGISTRY}:${GIT_TAG} |
72 |
| - if [ -n "${PUBLIC_REGISTRY}" ]; then |
73 |
| - crane copy ${SOURCE_REGISTRY}/${IMAGE_NAME}:${TAG_PASSED} ${PUBLIC_REGISTRY}:${GIT_TAG} |
74 |
| - fi |
75 |
| -
|
76 | 19 | - name: Create Release
|
77 | 20 | id: create-release
|
78 | 21 | uses: actions/create-release@v1
|
|
0 commit comments