Skip to content

Fix: yaml 파일 (#21) #12

Fix: yaml 파일 (#21)

Fix: yaml 파일 (#21) #12

Workflow file for this run

name: main-deploy
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup SSH key
run: |
echo "$SSH_KEY" > key.pem
chmod 600 key.pem
# Debugging: Verify the key file is correctly created and permissions are set
echo "SSH key file content:"
cat key.pem
echo "SSH key file permissions:"
ls -l key.pem
- name: Connect and run script on remote host
run: |
ssh -v -i key.pem -o StrictHostKeyChecking=no ${USER}@${HOST} "bash git-action.sh"
env:
USER: ${{ secrets.USER }}
HOST: ${{ secrets.HOST }}
SSH_KEY: ${{ secrets.SSH_KEY }}
AWS_DEFAULT_REGION: ap-northeast-2
AWS_REGION: ap-northeast-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
NODE_ENV: ${{ secrets.NODE_ENV }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
ACCESS_TOKEN_EXPIRATION: ${{ secrets.ACCESS_TOKEN_EXPIRATION }}
REFRESH_TOKEN_EXPIRATION: ${{ secrets.REFRESH_TOKEN_EXPIRATION }}
AWS_DYNAMODB_TABLE_NAME: ${{ secrets.AWS_DYNAMODB_TABLE_NAME }}
AWS_DYNAMODB_EMAIL_VERIFICATION_TABLE_NAME: ${{ secrets.AWS_DYNAMODB_EMAIL_VERIFICATION_TABLE_NAME }}
AWS_SES_EMAIL: ${{ secrets.AWS_SES_EMAIL }}
KAKAO_CLIENT_ID: ${{ secrets.KAKAO_CLIENT_ID }}
KAKAO_CLIENT_SECRET: ${{ secrets.KAKAO_CLIENT_SECRET }}
KAKAO_CALLBACK_URL: ${{ secrets.KAKAO_CALLBACK_URL }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GOOGLE_CALLBACK_URL: ${{ secrets.GOOGLE_CALLBACK_URL }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
- name: Remove Github Actions IP From Security Group
run: |
aws ec2 revoke-security-group-ingress --group-id ${{ secrets.AWS_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32