diff --git a/.github/workflows/cloud-platform-build-push-share.yml b/.github/workflows/cloud-platform-build-push-share.yml new file mode 100644 index 0000000..f0c8301 --- /dev/null +++ b/.github/workflows/cloud-platform-build-push-share.yml @@ -0,0 +1,41 @@ +name: cloud-platform-build-push-share + +on: + push: + branches: [main] + paths: + - 'docker-files/Dockerfile-share' + - '.github/workflows/cloud-platform-build-push-share.yml' + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + id-token: write # This is required for requesting the JWT + contents: read # This is required for actions/checkout + steps: + - name: Checkout current repo + uses: actions/checkout@v3 + + - name: Configure aws credentials for ECR + uses: aws-actions/configure-aws-credentials@v4.0.1 + with: + role-to-assume: ${{ secrets.ECR_ROLE_TO_ASSUME }} + aws-region: ${{ vars.ECR_REGION }} + + - name: ECR login + uses: aws-actions/amazon-ecr-login@v2 + id: login-ecr + + - name: Alfresco Enterprise image repository login + run: docker login quay.io -u ${{ secrets.ALFRESCO_QUAY_IO_USERNAME }} -p ${{ secrets.ALFRESCO_QUAY_IO_PASSWORD }} + + - name: Build image and push to ECR + working-directory: ./docker-files + run: | + docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG Dockerfile-share + docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG + env: + REGISTRY: ${{ steps.login-ecr.outputs.registry }} + REPOSITORY: ${{ vars.ECR_REPOSITORY }} + IMAGE_TAG: ${{ github.sha }}