From 5808291dc460956589bb0bb2620afe7a484c7fb5 Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Thu, 30 Sep 2021 17:03:28 -0300 Subject: [PATCH] Fix tag based Actions --- .../build-develop-india-courier.yaml | 12 +++--- .../build-develop-ireland-courier.yaml | 12 +++--- .../workflows/build-develop-sp-courier.yaml | 39 ++++++++++++++++++ .../build-production-india-courier.yaml | 39 ++++++++++++++++++ .../build-production-ireland-courier.yaml | 39 ++++++++++++++++++ .../build-production-sp-courier.yaml | 41 +++++++++++++++++++ 6 files changed, 172 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/build-develop-sp-courier.yaml create mode 100644 .github/workflows/build-production-india-courier.yaml create mode 100644 .github/workflows/build-production-ireland-courier.yaml create mode 100644 .github/workflows/build-production-sp-courier.yaml diff --git a/.github/workflows/build-develop-india-courier.yaml b/.github/workflows/build-develop-india-courier.yaml index 6320fc4ae..2104ca6ef 100644 --- a/.github/workflows/build-develop-india-courier.yaml +++ b/.github/workflows/build-develop-india-courier.yaml @@ -1,14 +1,19 @@ name: Build Develop India RP-courier on: push: - branches: - - 'feature/build' + tags: + - 'v*.*.*-develop*' jobs: docker: runs-on: ubuntu-latest environment: name: develop-india steps: + - name: Set output + id: vars + run: | + echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); + echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); - name: Check out the repo uses: actions/checkout@v2 with: @@ -17,9 +22,6 @@ jobs: uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Set output - id: vars - run: echo ::set-output name=tag::develop-v6.5.2 - name: Login to ECR uses: docker/login-action@v1 with: diff --git a/.github/workflows/build-develop-ireland-courier.yaml b/.github/workflows/build-develop-ireland-courier.yaml index d566b1f6c..ce3fbccc1 100644 --- a/.github/workflows/build-develop-ireland-courier.yaml +++ b/.github/workflows/build-develop-ireland-courier.yaml @@ -1,14 +1,19 @@ name: Build Develop Ireland RP-Courier on: push: - branches: - - 'feature/build' + tags: + - 'v*.*.*-develop*' jobs: docker: runs-on: ubuntu-latest environment: name: develop-ireland steps: + - name: Set output + id: vars + run: | + echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); + echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); - name: Check out the repo uses: actions/checkout@v2 with: @@ -17,9 +22,6 @@ jobs: uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Set output - id: vars - run: echo ::set-output name=tag::develop-v6.5.2 - name: Login to ECR uses: docker/login-action@v1 with: diff --git a/.github/workflows/build-develop-sp-courier.yaml b/.github/workflows/build-develop-sp-courier.yaml new file mode 100644 index 000000000..1f1c6e771 --- /dev/null +++ b/.github/workflows/build-develop-sp-courier.yaml @@ -0,0 +1,39 @@ +name: Build Develop SP RP-Courier +on: + push: + tags: + - 'v*.*.*-develop*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: develop + steps: + - name: Set output + id: vars + run: | + echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); + echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: feature/build + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-courier:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-india-courier.yaml b/.github/workflows/build-production-india-courier.yaml new file mode 100644 index 000000000..5f89899e3 --- /dev/null +++ b/.github/workflows/build-production-india-courier.yaml @@ -0,0 +1,39 @@ +name: Build Production India RP-courier +on: + push: + tags: + - '!v*.*.*-staging*' + - '!v*.*.*-develop*' + - 'v*.*.*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: production-india + steps: + - name: Set output + id: vars + run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 242357350604.dkr.ecr.ap-south-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 242357350604.dkr.ecr.ap-south-1.amazonaws.com/courier:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-ireland-courier.yaml b/.github/workflows/build-production-ireland-courier.yaml new file mode 100644 index 000000000..584298fec --- /dev/null +++ b/.github/workflows/build-production-ireland-courier.yaml @@ -0,0 +1,39 @@ +name: Build Production Ireland RP-Courier +on: + push: + tags: + - '!v*.*.*-staging*' + - '!v*.*.*-develop*' + - 'v*.*.*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: production-ireland + steps: + - name: Set output + id: vars + run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-sp-courier.yaml b/.github/workflows/build-production-sp-courier.yaml new file mode 100644 index 000000000..20bc0c6ff --- /dev/null +++ b/.github/workflows/build-production-sp-courier.yaml @@ -0,0 +1,41 @@ +name: Build Production SP RP-Courier +on: + push: + tags: + - '!v*.*.*-staging*' + - '!v*.*.*-develop*' + - 'v*.*.*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: production + steps: + - name: Set output + id: vars + run: | + echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); + echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-courier:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file