From d031126a1aec76575292f1ca55c1309037575b8e Mon Sep 17 00:00:00 2001 From: Aditya Sadalage Date: Wed, 7 Dec 2022 16:51:04 -0800 Subject: [PATCH] fix(cd): Add new cd steps with buildx for lambda arm/amd images (#37) # Problem # Arm support needs lambda image to be updated for both architectures # Solution # Update Lambda cd steps to use buildx for both images to be tagged together --- .github/workflows/cd-dgraph-lambda.yml | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/cd-dgraph-lambda.yml diff --git a/.github/workflows/cd-dgraph-lambda.yml b/.github/workflows/cd-dgraph-lambda.yml new file mode 100644 index 0000000..a3fccd3 --- /dev/null +++ b/.github/workflows/cd-dgraph-lambda.yml @@ -0,0 +1,31 @@ +name: cd-dgraph-lambda +on: workflow_dispatch +jobs: + dgraph-lambda-build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Set dgraph-lambda Release Version + run: | + #!/bin/bash + GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) + if [[ "$GIT_BRANCH_NAME" == "release/v"* ]]; + then + echo "this is a release branch" + else + echo "this is NOT a release branch" + exit 1 + fi + DGRAPH_LAMBDA_RELEASE_VERSION=$(git rev-parse --abbrev-ref HEAD | sed 's/release\///') + echo "making a new release for dgraph "$DGRAPH_LAMBDA_RELEASE_VERSION + echo "DGRAPH_LAMBDA_RELEASE_VERSION=$DGRAPH_LAMBDA_RELEASE_VERSION" >> $GITHUB_ENV + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD_TOKEN }} + - name: Push dgraph-lambda images + run: | + docker buildx create --name builder --driver docker-container + docker buildx use builder + docker buildx build -t dgraph/dgraph-lambda:${{ env.DGRAPH_LAMBDA_RELEASE_VERSION }} --push --platform=linux/arm64,linux/amd64 .