Skip to content

fix(*): update the branch name of the staging deployment script #20

fix(*): update the branch name of the staging deployment script

fix(*): update the branch name of the staging deployment script #20

Workflow file for this run

name: Deploy Kaapi to EC2 Staging
on:
push:
branches:
- feat/frontend-cicd-deployment
jobs:
deploy:
runs-on: ubuntu-latest
environment: AWS_STAGING_ENV
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Deploy via SSM
run: |
aws ssm send-command \
--instance-ids "${{ secrets.EC2_INSTANCE_ID }}" \
--document-name "AWS-RunShellScript" \
--parameters 'commands=["export HOME=/home/ubuntu && export PATH=/data/.nvm/versions/node/v24.11.0/bin:$PATH && git config --global --add safe.directory ${{ secrets.BUILD_DIRECTORY }} && set -e && cd ${{ secrets.BUILD_DIRECTORY }} && git pull origin main && npm ci && npm run build && sudo -u ubuntu PM2_HOME=/home/ubuntu/.pm2 /data/.nvm/versions/node/v24.11.0/bin/pm2 restart ${{ secrets.PM2_APP_NAME }}"]' \
--region ${{ secrets.AWS_REGION }}