Skip to content

Commit

Permalink
Fix tag based Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cicerow-weni committed Sep 30, 2021
1 parent 3d74f87 commit 5808291
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 10 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build-develop-india-courier.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/build-develop-ireland-courier.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/build-develop-sp-courier.yaml
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions .github/workflows/build-production-india-courier.yaml
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions .github/workflows/build-production-ireland-courier.yaml
Original file line number Diff line number Diff line change
@@ -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
41 changes: 41 additions & 0 deletions .github/workflows/build-production-sp-courier.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5808291

Please sign in to comment.