File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed
Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 99 runs-on : ubuntu-latest
1010 steps :
1111 # - uses: actions/checkout@v4
12- - name : Test step
13- run : |
14- echo "깃헙액션 테스트, 현재 시간은:"
15- TZ=Asia/Seoul date
1612
13+ # 이 아래 애들은 deploy 스텝에서 적용해야될듯?
1714 - name : Get Gihub Actions VM IP
1815 id : ip
1916 uses : haythem/public-ip@v1.3
3633 --protocol tcp \
3734 --port 22 \
3835 --cidr ${{ steps.ip.outputs.ipv4 }}/32
36+
37+ - name : Test EC2 Connection And Manipulation
38+ uses : appleboy/ssh-action@master
39+ with :
40+ username : ubuntu
41+ host : ${{ secrets.EC2_ELASTIC_IP }}
42+ key : ${{ secrets.EC2_SSH_KEY }}
43+ script_stop : true
44+ script : |
45+ echo "[✔] GitHub Actions Connection Success" | tee -a ~/cicd-log.txt
46+ echo "Time: $(date '+%Y-%m-%d %H:%M:%S')" | tee -a ~/cicd-log.txt
47+ echo "Branch: ${{ github.ref_name }}" | tee -a ~/cicd-log.txt
48+ echo "Commit: ${{ github.sha }}" | tee -a ~/cicd-log.txt
49+ echo "-------------------------------" | tee -a ~/cicd-log.txt
50+
51+ - name : Remove GitHub Actions IP
52+ run : |
53+ aws ec2 revoke-security-group-ingress \
54+ --group-id ${{ secrets.AWS_SECURITY_GROUP_ID }} \
55+ --protocol tcp \
56+ --port 22 \
57+ --cidr ${{ steps.ip.outputs.ipv4 }}/32
3958
4059 # uses: actions/setup-java@v4
4160 # with:
You can’t perform that action at this time.
0 commit comments