-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d7fb86
commit 50c9ba4
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Build and push Docker image to Heroku | ||
description: Build Docker image for server, swaps tracker and maker mock and push to Heroku Container Registry | ||
|
||
inputs: | ||
heroku_api_key: | ||
description: "Heroku API key" | ||
required: true | ||
heroku_app_name: | ||
description: "Heroku app name" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Login to Heroku Container Registry | ||
shell: bash | ||
run: heroku container:login | ||
env: | ||
HEROKU_API_KEY: ${{ inputs.heroku_api_key }} | ||
|
||
- name: Build Docker Image for Server | ||
shell: bash | ||
run: | | ||
docker build --build-arg APP_PATH=./cmd/order-book -t registry.heroku.com/$HEROKU_APP_NAME/web -f cmd/order-book.Dockerfile . | ||
env: | ||
HEROKU_APP_NAME: ${{ inputs.heroku_app_name }} | ||
|
||
- name: Push Docker Image for Server to Registry | ||
shell: bash | ||
run: docker push registry.heroku.com/$HEROKU_APP_NAME/web | ||
env: | ||
HEROKU_API_KEY: ${{ inputs.heroku_api_key }} | ||
HEROKU_APP_NAME: ${{ inputs.heroku_app_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Build and deploy | ||
env: | ||
terraform_state_s3_bucket: "orbs-terraform-tfstate" | ||
terraform_state_s3_key_prefix: "order-book" | ||
terraform_state_dynamodb_table: "orbs-terraform-locks" | ||
build_path: "." | ||
# on: | ||
# push: | ||
# branches: ["main"] | ||
# paths: | ||
# - "**" | ||
on: push | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
jobs: | ||
build-server: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check Out Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build server image and push to Heroku | ||
uses: ./.github/actions/build-push-image | ||
with: | ||
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} | ||
heroku_app_name: "ob-server-development" | ||
|
||
build-swaps-tracker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check Out Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build swaps tracker image and push to Heroku | ||
uses: ./.github/actions/build-push-image | ||
with: | ||
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} | ||
heroku_app_name: "ob-swaps-tracker-development" | ||
|
||
build-maker-mock: | ||
runs-on: ubuntu-latest | ||
needs: [build-server, build-swaps-tracker] | ||
steps: | ||
- name: Check Out Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Heroku Container Registry | ||
run: heroku container:login | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
|
||
- name: Build and Push Docker Image | ||
run: | | ||
docker build -t registry.heroku.com/ob-maker-mock/worker -f e2e/maker/Dockerfile . | ||
docker push registry.heroku.com/ob-maker-mock/worker | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
|
||
- name: Release Image | ||
run: heroku container:release worker --app ob-maker-mock | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} |