-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): adding in docker image building
- Loading branch information
Showing
4 changed files
with
92 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,67 @@ | ||
name: 'Re-usable Docker Build Flow' | ||
on: | ||
workflow_call: | ||
inputs: | ||
scope: | ||
description: 'Turbo Repo scope to run the build for' | ||
required: true | ||
type: string | ||
docker-repo-name: | ||
description: 'Docker name of the repo <account-id>.dkr.ecr.us-east-1.amazonaws.com/<name>' | ||
required: true | ||
type: string | ||
app-path: | ||
description: 'The path of where the application is located in the monorepo ie servers/<app-name>' | ||
required: true | ||
type: string | ||
app-port: | ||
description: 'The port the application runs on ie 4006' | ||
required: true | ||
type: int | ||
sentry-org: | ||
description: 'The org name used in sentry. Used to upload source maps' | ||
required: false | ||
type: string | ||
default: pocket | ||
sentry-project: | ||
description: 'The project name used in sentry. Used to upload source maps' | ||
required: true | ||
type: string | ||
sentry-token: | ||
description: 'The token used to access sentry. Used to upload source maps' | ||
required: false | ||
type: string | ||
default: ${{ secrets.SENTRY_BEARER }} | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# can be useful if you want to add emulation support with QEMU to be able to build against more platforms. | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
# action will create and boot a builder using by default the docker-container driver. | ||
# This is not required but recommended using it to be able to build multi-platform images, export cache, etc. | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: false | ||
tags: ${{inputs['docker-repo-name']}}:${{ github.sha }} | ||
build-args: | | ||
GIT_SHA=${{ github.sha }} | ||
SCOPE=${{inputs['scope']}} | ||
APP_PATH=${{inputs['app-path']}} | ||
SENTRY_AUTH_TOKEN=${{inputs['sentry-token']}} | ||
SENTRY_ORG=${{inputs['sentry-org']}} | ||
SENTRY_PROJECT=${{inputs['sentry-project']}} | ||
PORT=${{inputs['app-port']}} |
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
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
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