-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TECH-3629 - Moving Chainlog to sky.money
- Loading branch information
1 parent
b9968c9
commit 3b667a6
Showing
2 changed files
with
117 additions
and
1 deletion.
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,116 @@ | ||
on: | ||
push: | ||
branches: | ||
- staging | ||
- TECH-3629-Chainlog | ||
|
||
name: Deploy to AWS Staging | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
environment: staging | ||
env: | ||
AWS_REGION: us-east-2 | ||
CLUSTER_NAME: maker-staging | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.GA_OIDC_EKS_STAGING }} | ||
role-session-name: chainlog-staging | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Extract commit hash | ||
id: vars | ||
shell: bash | ||
run: | | ||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- name: Build, tag, and push image to Amazon ECR | ||
id: build-image | ||
env: | ||
SHA_TAG: ${{ steps.vars.outputs.sha_short }} | ||
LATEST_TAG: latest | ||
ENVIRONMENT_TAG: staging | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
run: | | ||
# Build Docker containers and | ||
# push them to ECR: | ||
# - chainlog-ui | ||
docker pull $ECR_REGISTRY/chainlog-ui-staging:$LATEST_TAG || true | ||
docker build -t chainlog-ui-staging \ | ||
-t $ECR_REGISTRY/chainlog-ui-staging:$SHA_TAG \ | ||
-t $ECR_REGISTRY/chainlog-ui-staging:$LATEST_TAG \ | ||
-t $ECR_REGISTRY/chainlog-ui-staging:$ENVIRONMENT_TAG \ | ||
-f Dockerfile.ui \ | ||
. | ||
docker push $ECR_REGISTRY/chainlog-ui-staging --all-tags | ||
# - chainlog-checksum | ||
docker pull $ECR_REGISTRY/chainlog-checksum-staging:$LATEST_TAG || true | ||
docker build -t chainlog-checksum-staging \ | ||
-t $ECR_REGISTRY/chainlog-checksum-staging:$SHA_TAG \ | ||
-t $ECR_REGISTRY/chainlog-checksum-staging:$LATEST_TAG \ | ||
-t $ECR_REGISTRY/chainlog-checksum-staging:$ENVIRONMENT_TAG \ | ||
-f Dockerfile.checksum \ | ||
. | ||
docker push $ECR_REGISTRY/chainlog-checksum-staging --all-tags | ||
# - chainlog-logger | ||
docker pull $ECR_REGISTRY/chainlog-logger-staging:$LATEST_TAG || true | ||
docker build -t chainlog-logger-staging \ | ||
-t $ECR_REGISTRY/chainlog-logger-staging:$SHA_TAG \ | ||
-t $ECR_REGISTRY/chainlog-logger-staging:$LATEST_TAG \ | ||
-t $ECR_REGISTRY/chainlog-logger-staging:$ENVIRONMENT_TAG \ | ||
-f Dockerfile.logger \ | ||
. | ||
docker push $ECR_REGISTRY/chainlog-logger-staging --all-tags | ||
- name: Preparing Helm values files | ||
id: preparing-helm-values | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
run: | | ||
sed -i 's/${ECR_REGISTRY}/'$(echo $ECR_REGISTRY)/ deploy/staging/chainlog-logger.yaml | ||
sed -i 's/${ECR_REGISTRY}/'$(echo $ECR_REGISTRY)/ deploy/staging/chainlog-ui.yaml | ||
- name: Deploying Chainlog UI to Kubernetes with Helm | ||
uses: bitovi/github-actions-deploy-eks-helm@v1.2.4 | ||
with: | ||
values: image.repository=${{ steps.login-ecr.outputs.registry }}/chainlog-ui-staging,image.tag=${{ steps.vars.outputs.sha_short }} | ||
cluster-name: ${{ env.CLUSTER_NAME }} | ||
config-files: deploy/staging/chainlog-ui.yaml | ||
chart-path: techops-services/common | ||
namespace: chainlog | ||
timeout: 5m0s | ||
name: chainlog-ui | ||
chart-repository: https://techops-services.github.io/helm-charts | ||
version: 0.0.19 | ||
atomic: true | ||
|
||
- name: Deploying Chainlog Logger to Kubernetes with Helm | ||
uses: bitovi/github-actions-deploy-eks-helm@v1.2.4 | ||
with: | ||
values: image.repository=${{ steps.login-ecr.outputs.registry }}/chainlog-logger-staging,image.tag=${{ steps.vars.outputs.sha_short }} | ||
cluster-name: ${{ env.CLUSTER_NAME }} | ||
config-files: deploy/staging/chainlog-logger.yaml | ||
chart-path: techops-services/common | ||
namespace: chainlog | ||
timeout: 5m0s | ||
name: chainlog-logger | ||
chart-repository: https://techops-services.github.io/helm-charts | ||
version: 0.0.19 | ||
atomic: true | ||
|
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