-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Luke Lombardi <[email protected]>
- Loading branch information
1 parent
3cf0183
commit 11ad80b
Showing
2 changed files
with
55 additions
and
2 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
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,47 @@ | ||
name: Build and Push Worker | ||
|
||
on: | ||
release: | ||
types: [created] | ||
tags: | ||
- 'worker-*' | ||
|
||
jobs: | ||
build_and_release_worker: | ||
environment: Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to Amazon ECR | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
id: login-ecr | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: ${{ secrets.AWS_REGION }} | ||
with: | ||
mask-password: 'true' | ||
registry-type: public | ||
|
||
- name: Extract tag name | ||
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/worker-}" >> $GITHUB_ENV | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./docker/Dockerfile.worker | ||
push: true | ||
tags: ${{ secrets.ECR_REGISTRY }}/beta9-worker:${{ env.TAG_NAME }} | ||
build-args: --target=release | ||
load: false | ||
registry: ${{ steps.login-ecr.outputs.registry }} | ||
repository: ${{ steps.login-ecr.outputs.registry }}/beta9-worker | ||
add_git_labels: true | ||
tag_with_ref: true |