This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
-
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.
feat: dev/stage images and upload to ecr
- Loading branch information
1 parent
0cc983d
commit fa4af1f
Showing
3 changed files
with
144 additions
and
10 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: "[Build] dev user-ms image" | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-dev-user-ms: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
cache: "maven" | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1-node16 | ||
with: | ||
role-to-assume: arn:aws:iam::570620554963:role/github_actions_ecr_vexl | ||
role-session-name: GithubActionsCloudInfrastructure | ||
aws-region: eu-west-1 | ||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build dev user-ms-ms java | ||
run: mvn package | ||
|
||
- name: Build and push dev user-ms image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
push: true | ||
build-args: | | ||
CI_PROJECT_NAME=${{ github.repository }} | ||
CI_COMMIT_SHORT_SHA=${{ github.sha }} | ||
KUBE_DOMAIN=vexl.it | ||
PROFILE=dev | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/user-ms:dev | ||
ghcr.io/${{ github.repository_owner }}/user-ms:dev-${{ github.sha }} | ||
${{ steps.login-ecr.outputs.registry }}/user-ms:dev | ||
${{ steps.login-ecr.outputs.registry }}/user-ms:dev-${{ github.sha }} |
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,62 @@ | ||
name: "[Build] stage user-ms image" | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-stage-user-ms: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
cache: "maven" | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1-node16 | ||
with: | ||
role-to-assume: arn:aws:iam::570620554963:role/github_actions_ecr_vexl | ||
role-session-name: GithubActionsCloudInfrastructure | ||
aws-region: eu-west-1 | ||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build stage user-ms-ms java | ||
run: mvn package | ||
|
||
- name: Build and push stage user-ms image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
push: true | ||
build-args: | | ||
CI_PROJECT_NAME=${{ github.repository }} | ||
CI_COMMIT_SHORT_SHA=${{ github.sha }} | ||
KUBE_DOMAIN=vexl.it | ||
PROFILE=stage | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/user-ms:stage | ||
ghcr.io/${{ github.repository_owner }}/user-ms:stage-${{ github.sha }} | ||
${{ steps.login-ecr.outputs.registry }}/user-ms:stage | ||
${{ steps.login-ecr.outputs.registry }}/user-ms:stage-${{ github.sha }} |