-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to publish to ECR, modify dockerfile and makefile
This commit adds the workflow to automatically publish images on pushes to the main branch. I update the dockerfile to use the 3.10-slim image, which more closely matches how we do other python dockerfiles. i update the makefile to have two dev specific commands, "dist-dev" which creates the docker image locally and "publish-dev" which then publishes it to the dev ECR for use in stepfunctions.
- Loading branch information
Showing
3 changed files
with
49 additions
and
22 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,37 @@ | ||
name: dev ECR push | ||
on: | ||
push: | ||
branches: | ||
- main | ||
# Set defaults | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
AWS_REGION: "us-east-1" | ||
AWS_ACCOUNT_ID: "222053980223" | ||
IAM_ROLE: "timdex-transmogrifier-gha-dev" | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy dev build | ||
runs-on: ubuntu-latest | ||
# These permissions are needed to interact with GitHub's OIDC Token endpoint. | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/${{ env.IAM_ROLE }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: Build image | ||
run: make dist-dev | ||
- name: Push image | ||
run: make publish-dev | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:3 AS py3 | ||
FROM python:3.10-slim AS py3 | ||
RUN pip install pipenv | ||
|
||
FROM py3 AS wheel | ||
|
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