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 .