-
Notifications
You must be signed in to change notification settings - Fork 78
45 lines (44 loc) · 1.44 KB
/
container-image.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
name: Container Images
on: push
env:
REGION : "us-east-1"
jobs:
build:
# this is to prevent the job to run at forked projects
if: github.repository == 'kubernetes-sigs/aws-fsx-csi-driver'
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: arn:aws:iam::664215443545:role/LustreCSIDriverImagePublisherRole
aws-region: ${{ env.REGION }}
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
- name: Build, tag, and push docker image to Amazon ECR Public Repository
env:
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
REGISTRY_ALIAS: fsx-csi-driver
REPOSITORY: aws-fsx-csi-driver
run: |
BRANCH_OR_TAG=$(echo $GITHUB_REF | cut -d'/' -f3)
if [ "$BRANCH_OR_TAG" = "master" ]; then
GIT_TAG=$GITHUB_SHA
else
GIT_TAG=$BRANCH_OR_TAG
fi
export REGISTRY=$REGISTRY/$REGISTRY_ALIAS
export TAG=$GIT_TAG
make all-push