From bccb54c474bca05605a1df99dc963e760edb6571 Mon Sep 17 00:00:00 2001 From: Sravan Reddy Date: Thu, 3 Jul 2025 11:47:57 +0530 Subject: [PATCH 1/2] Github deploy action --- .github/workflows/deploy.yml | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..204e99a4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,56 @@ +name: Deploy + +env: + AWS_REGION: 'us-east-1' + +permissions: + id-token: write + contents: read + +on: + # workflow_run: + # workflows: [CI] + # types: [completed] + # branches: [main] + workflow_dispatch: + inputs: + environment: + required: true + default: 'staging' + type: choice + options: + - production + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: actions/setup-ruby@v1 + + - name: Install Kamal + run: gem install kamal -v '~> 1.9.2' + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2.5.1 + with: + key: ${{ secrets.SSH_KEY }} + known_hosts: ${{ secrets.KNOWN_HOSTS }} + config: | + Host * + StrictHostKeyChecking no + UserKnownHostsFile=/dev/null + + - name: configure aws credentials + uses: aws-actions/configure-aws-credentials@v3.0.1 + with: + role-to-assume: arn:aws:iam::037129986032:role/github_deploy + role-session-name: GithubDeploy + aws-region: ${{ env.AWS_REGION }} + + - id: deploy + working-directory: ./deploy + run: 'kamal deploy' From 6863128482f04f6af29ab56f27ec9d7b45306ada Mon Sep 17 00:00:00 2001 From: Sravan Reddy Date: Thu, 3 Jul 2025 12:21:03 +0530 Subject: [PATCH 2/2] change default --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 204e99a4..08219a9e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,7 +16,7 @@ on: inputs: environment: required: true - default: 'staging' + default: 'production' type: choice options: - production