Skip to content

add zeeverse testnet contracts #53

add zeeverse testnet contracts

add zeeverse testnet contracts #53

Workflow file for this run

name: Deploy API
on:
workflow_dispatch:
push:
paths:
- "apps/api/**"
- "packages/**"
branches:
- main
tags:
- api-v*
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ startsWith(github.ref, 'refs/tags/') && 'production' || 'development' }}
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
- name: Log in to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
IMAGE_TAG: ${{ steps.login-ecr.outputs.registry }}/${{ vars.ECR_REPOSITORY }}:${{ github.sha }}
run: |
docker build -t $IMAGE_TAG -f ./apps/api/Dockerfile .
docker push $IMAGE_TAG
echo "image=$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ./apps/api/.aws/task-definition-${{ vars.ENVIRONMENT }}.json
container-name: ${{ vars.ENVIRONMENT }}-identity
image: ${{ steps.build-image.outputs.image }}
environment-variables: |
AWS_REGION=${{ vars.AWS_REGION }}
API_ENV_SECRET_NAME=${{ vars.API_ENV_SECRET_NAME }}
DATABASE_SECRET_NAME=${{ vars.DATABASE_SECRET_NAME }}
- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ vars.ECS_SERVICE }}
cluster: ${{ vars.ECS_CLUSTER }}
wait-for-service-stability: true