Merge pull request #375 from jacobwolfaws/release-1.2 #176
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Container Images | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | |
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 |