Skip to content

Commit

Permalink
ci: Replace fly deployment with AWS
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed May 27, 2024
1 parent 55862df commit d84913d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 114 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/release-api.yml

This file was deleted.

35 changes: 25 additions & 10 deletions .github/workflows/release-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,42 @@ on:
push:
branches:
- main
tags:
- '*'

jobs:
build-web-release:
runs-on: ubuntu-latest
environment: alpha
name: Build and push Web docker image for release
if: ${{ startsWith(github.ref , 'refs/tags/') }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
aws-access-key-id: ${{ secrets.ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.SECRET_KEY }}
aws-region: ap-south-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build Docker image
run: docker build -t keyshade/keyshade-web:${{ github.ref_name }} keyshade/keyshade-web:latest -f ./apps/web/Dockerfile .
id: build
env:
ECR_REGISTRY: ${{ vars.ECR_REGISTRY }}
ECR_REPOSITORY: ${{ vars.ECR_REPOSITORY }}
run: |
# Build a docker container and push it to ECR
aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin $ECR_REGISTRY
docker build -t keyshade/keyshade-web:alpha-${GITHUB_SHA::6} $ECR_REGISTRY/$ECR_REPOSITORY:latest -f ./apps/web/Dockerfile .
echo "Pushing image to ECR..."
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
echo "name=image::$ECR_REGISTRY/$ECR_REPOSITORY:latest" >> $GITHUB_OUTPUT
- name: Push Docker image
run: docker push keyshade/keyshade-web
- name: Force re-deploy task in service
id: force-redeploy
run: |
aws ecs update-service --cluster shaer-stage-cluster --service backend-stage-service --force-new-deployment
20 changes: 0 additions & 20 deletions .github/workflows/stage-web.yml

This file was deleted.

33 changes: 0 additions & 33 deletions fly.api.toml

This file was deleted.

23 changes: 0 additions & 23 deletions fly.web.toml

This file was deleted.

0 comments on commit d84913d

Please sign in to comment.