-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update: Dockerfile to build image #24 * ci: create workflow to push keycloak with activated oid4vci to AWS ECR #24
- Loading branch information
1 parent
0858e18
commit c389ae9
Showing
2 changed files
with
62 additions
and
6 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,62 @@ | ||
name: ci-cd | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
REGISTRY: 917848404243.dkr.ecr.eu-central-1.amazonaws.com | ||
IMAGE_NAME: kcoid4vci | ||
ECS_SERVICE: kcoid4vci | ||
ECS_CLUSTER: kcoid4vci | ||
ECS_TASK_DEFINITION: .aws/task-definition.json | ||
CONTAINER_NAME: "app" | ||
|
||
jobs: | ||
build-deliver: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/arm/v6,linux/arm/v7,linux/amd64,linux/arm64 | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Upload image to ECR | ||
uses: appleboy/docker-ecr-action@master | ||
with: | ||
access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
repo: ${{ env.IMAGE_NAME }} | ||
registry: ${{ env.REGISTRY }} | ||
region: ${{ secrets.AWS_REGION }} |
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