Skip to content

Commit

Permalink
chore: create separate files for release chronos and db-migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Amninder Kaur committed Aug 16, 2023
1 parent 735041e commit e22963c
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: push images to ghcr.io

on:
push:
branches:
- master

jobs:
build:
uses: ./.github/workflows/rust_build.yml
publish:
runs-on: ubuntu-latest
needs: build
if: needs.build.result == 'success'
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.AMN_PAT }}

- name: Build the chronos Docker image
run: |
docker build -f Dockerfile.chronos . --tag ghcr.io/kindredgroup/chronos:latest
docker push ghcr.io/kindredgroup/chronos:latest
42 changes: 42 additions & 0 deletions .github/workflows/release-db-migration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: release db-migration binary on tag

# on tag push, build and push docker images to ghcr.io
# and creating a GitHub release
# and publish the release to GitHub
on:
release:
types: [created]
push:
tags:
# only build on tags that start with 'v'
# having major, minor and path version numbers
# along with alpha beta support
# e.g. v1.0.0-alpha.1, v1.0.0-beta.1, v1.0.0
- 'v[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z0-9]+)+.[0-9]'
- 'v[0-9]+.[0-9]+.[0-9]'
- 'v[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z0-9]+)'

jobs:
build:
uses: ./.github/workflows/rust_build.yml
publish:
runs-on: ubuntu-latest
needs: build
if: needs.build.result == 'success'
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.AMN_PAT }}


- name: Build and publish the chronos-pg-migration Docker image
run: |
echo "Releaase Tag name: $GITHUB_REF_NAME"
docker build -f Dockerfile.chronos-pg-migrations . --tag ghcr.io/$GITHUB_REPOSITORY/db-migration:$GITHUB_REF_NAME
docker push ghcr.io/$GITHUB_REPOSITORY/db-migration:$GITHUB_REF_NAME
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
# along with alpha beta support
# e.g. v1.0.0-alpha.1, v1.0.0-beta.1, v1.0.0
- 'v[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z0-9]+)+.[0-9]?'
- 'v[0-9]+.[0-9]+.[0-9]'
- 'v[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z0-9]+)'

jobs:
build:
Expand All @@ -33,5 +35,5 @@ jobs:

- name: Build and publish chronos for chronos image
run: |
docker build -f Dockerfile.chronos . --tag ghcr.io/GITHUB_REPOSITORY:$GITHUB_REF_NAME
docker build -f Dockerfile.chronos . --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME
docker push ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME

0 comments on commit e22963c

Please sign in to comment.