-
Notifications
You must be signed in to change notification settings - Fork 31
83 lines (80 loc) · 3.1 KB
/
release.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
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
name: Release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
# This workflow copies image from testing private repository to:
# 1) private ARS source repository
# 2) public repository
env:
AWS_SRC_REGION : "us-east-1" # this is where our testing repo exists
AWS_DEST_REGION : "us-west-2" # this is where our prod repos exist
COMMIT_ID: ${{ github.sha }}
GIT_TAG: ${{ github.ref_name }}
IMAGE_NAME: "s3-csi-driver"
PUBLIC_REGISTRY: "public.ecr.aws/mountpoint-s3-csi-driver/aws-mountpoint-s3-csi-driver"
jobs:
build:
# this is to prevent the job to run at forked projects
if: github.repository == 'awslabs/mountpoint-s3-csi-driver'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Set up crane
uses: imjasonh/[email protected]
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Configure AWS Credentials from Test acccount
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: ${{ secrets.TEST_IAM_ROLE }}
aws-region: ${{ env.AWS_SRC_REGION }}
- name: Login to Amazon ECR test
id: login-ecr-test
uses: aws-actions/amazon-ecr-login@v2
- name: Configure AWS Credentials from Prod account
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: ${{ secrets.PROD_IAM_IMAGE_ROLE }}
aws-region: ${{ env.AWS_DEST_REGION }}
- name: Configure AWS Credentials from Prod account (for public repo)
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: ${{ secrets.PROD_IAM_IMAGE_ROLE }}
aws-region: us-east-1
- name: Login to Amazon ECR prod
id: login-ecr-prod
uses: aws-actions/amazon-ecr-login@v2
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Promote image
env:
ARS_REGISTRY: ${{ secrets.ARS_REGISTRY }}
run: |
crane copy ${{ steps.login-ecr-test.outputs.registry }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_ID }} ${ARS_REGISTRY}:${{ env.GIT_TAG }}
crane copy ${{ steps.login-ecr-test.outputs.registry }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_ID }} ${{ env.PUBLIC_REGISTRY }}:${{ env.GIT_TAG }}
- name: Create Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
Mountpoint for Amazon S3 CSI Driver
## CHANGELOG
See [CHANGELOG](https://github.com/awslabs/mountpoint-s3-csi-driver/blob/main/CHANGELOG.md) for full list of changes
draft: true
prerelease: false