|
7 | 7 | required: true |
8 | 8 |
|
9 | 9 | permissions: |
| 10 | + id-token: write |
10 | 11 | contents: read |
11 | 12 |
|
| 13 | +env: |
| 14 | + IMAGE_HOST: "${{ secrets.BETA_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com" |
| 15 | + IMAGE: "${{ secrets.BETA_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller" |
| 16 | + IMAGE_TAG: "${{ github.event.inputs.tag }}" |
| 17 | + IMAGE_TAG_AMD: "${{ github.event.inputs.tag }}-linux_amd64" |
| 18 | + IMAGE_TAG_ARM: "${{ github.event.inputs.tag }}-linux_arm64" |
| 19 | + |
12 | 20 | jobs: |
13 | | - build: |
14 | | - name: integration-test |
15 | | - runs-on: [ self-hosted, aws-app-mesh-controller-for-k8s, X64 ] |
| 21 | + integration-test: |
| 22 | + name: Integration Test |
| 23 | + runs-on: ubuntu-22.04 |
16 | 24 | steps: |
17 | | - - name: clean work dir from previous runs |
18 | | - run: | |
19 | | - rm -rf * |
20 | | - - name: setup go 1.17 |
21 | | - uses: actions/setup-go@v3 |
22 | | - with: |
23 | | - go-version: '1.17.*' |
24 | | - id: go |
25 | | - - name: setup environment |
26 | | - run: | |
27 | | - source ~/.bashrc |
28 | | - - name: checkout code |
29 | | - uses: actions/checkout@v2 |
| 25 | + - name: Checkout Code |
| 26 | + uses: actions/checkout@v3 |
30 | 27 | with: |
31 | 28 | ref: refs/tags/${{ github.event.inputs.tag }} |
32 | | - - name: setup kind and run integration tests |
33 | | - run: VERSION=${{ github.event.inputs.tag }} make integration-test |
34 | | - - name: cleanup all the kind clusters |
35 | | - run: VERSION=${{ github.event.inputs.tag }} make delete-all-kind-clusters |
36 | | - build-arm64: |
37 | | - name: build-arm64 |
38 | | - runs-on: [ self-hosted, aws-app-mesh-controller-for-k8s, ARM64 ] |
| 29 | + - name: Run integration test action |
| 30 | + uses: ./.github/actions/integration-test |
| 31 | + with: |
| 32 | + aws_role: "${{ secrets.BETA_TEST_AWS_ROLE }}" |
| 33 | + vpc_id: "${{ secrets.INTEG_TEST_VPC }}" |
| 34 | + account_id: "${{ secrets.BETA_AWS_ACCOUNT }}" |
| 35 | + |
| 36 | + push-images: |
| 37 | + name: Build And Push Images |
| 38 | + runs-on: ubuntu-22.04 |
| 39 | + needs: [ integration-test ] |
39 | 40 | steps: |
40 | | - - name: clean work dir from previous runs |
| 41 | + - name: Clean |
41 | 42 | run: | |
42 | 43 | rm -rf * |
43 | | - - name: setup go 1.17 |
44 | | - uses: actions/setup-go@v3 |
45 | | - with: |
46 | | - go-version: '1.17.*' |
47 | | - id: go |
48 | | - - name: setup environment |
49 | | - run: | |
50 | | - source ~/.bashrc |
51 | | - - name: checkout code |
52 | | - uses: actions/checkout@v2 |
| 44 | + - name: Checkout Code |
| 45 | + uses: actions/checkout@v3 |
53 | 46 | with: |
54 | 47 | ref: refs/tags/${{ github.event.inputs.tag }} |
55 | | - - name: build for arm64 |
56 | | - run: | |
57 | | - docker buildx build --platform linux/arm64 -t ${{ secrets.CI_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller:${{ github.event.inputs.tag }}-linux_arm64 . --load |
58 | | - aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin ${{ secrets.CI_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com |
59 | | - docker push ${{ secrets.CI_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller:${{ github.event.inputs.tag }}-linux_arm64 |
60 | | - beta-release: |
61 | | - name: beta-release |
62 | | - runs-on: ubuntu-18.04 |
63 | | - needs: [ build, build-arm64 ] |
64 | | - permissions: |
65 | | - id-token: write |
66 | | - contents: read |
67 | | - steps: |
68 | | - - name: Configure AWS Credentials (build) |
69 | | - uses: aws-actions/configure-aws-credentials@v1 |
70 | | - with: |
71 | | - aws-region: us-west-2 |
72 | | - role-to-assume: ${{ secrets.CI_AWS_ROLE }} |
73 | | - role-session-name: ControllerBetaRelease |
74 | | - - name: Pull docker image |
75 | | - run: | |
76 | | - aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin ${{ secrets.CI_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com |
77 | | - docker pull ${{ secrets.CI_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller:${{ github.event.inputs.tag }} |
78 | | - docker pull ${{ secrets.CI_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller:${{ github.event.inputs.tag }}-linux_arm64 |
79 | | - - name: Configure AWS Credentials (beta) |
80 | | - uses: aws-actions/configure-aws-credentials@v1 |
| 48 | + |
| 49 | + - name: Configure AWS Credentials |
| 50 | + uses: aws-actions/configure-aws-credentials@v1-node16 |
81 | 51 | with: |
82 | 52 | aws-region: us-west-2 |
83 | 53 | role-to-assume: ${{ secrets.BETA_AWS_ROLE }} |
84 | | - role-session-name: ControllerBetaRelease |
85 | | - - name: Push docker image |
| 54 | + role-session-name: ImagePusher |
| 55 | + |
| 56 | + - name: Build Images |
86 | 57 | run: | |
87 | | - aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin ${{ secrets.BETA_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com |
88 | | - docker tag ${{ secrets.CI_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller:${{ github.event.inputs.tag }} ${{ secrets.BETA_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller:${{ github.event.inputs.tag }} |
89 | | - docker tag ${{ secrets.CI_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller:${{ github.event.inputs.tag }}-linux_arm64 ${{ secrets.BETA_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller:${{ github.event.inputs.tag }}-linux_arm64 |
90 | | - docker push ${{ secrets.BETA_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller:${{ github.event.inputs.tag }} |
91 | | - docker push ${{ secrets.BETA_AWS_ACCOUNT }}.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller:${{ github.event.inputs.tag }}-linux_arm64 |
| 58 | + aws ecr get-login-password --region us-west-2 | \ |
| 59 | + docker login --username AWS --password-stdin $IMAGE_HOST |
| 60 | + # Note: right now, this pushes the amd image under the default. This |
| 61 | + # behavior should be changed to supporting multiarch shortly. |
| 62 | + docker buildx build --platform linux/amd64 -t "${IMAGE}:${IMAGE_TAG}" . --push |
| 63 | + docker buildx build --platform linux/arm64 -t "${IMAGE}:${IMAGE_TAG_ARM}" . --push |
0 commit comments