File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828 - name : Build with Gradle
2929 run : ./gradlew build
3030
31+ - name : Get GitHub Actions IP
32+ id : ip
33+ uses : haythem/public-ip@v1.3
34+
35+ - name : Configure AWS credentials
36+ uses : aws-actions/configure-aws-credentials@v5.1.1
37+ with :
38+ aws-access-key-id : ${{ secrets.AWS_USER_ACCESS_KEY }}
39+ aws-secret-access-key : ${{ secrets.AWS_USER_SECRET_KEY }}
40+ aws-region : ap-northeast-2
41+
42+ - name : Add GitHub IP to Security Group
43+ run : |
44+ aws ec2 authorize-security-group-ingress \
45+ --group-id ${{ secrets.AWS_SECURITY_GROUP_ID }} \
46+ --protocol tcp \
47+ --port 22 \
48+ --cidr ${{ steps.ip.outputs.ipv4 }}/32
49+
3150 - name : copy file via ssh
3251 uses : appleboy/scp-action@master
3352 with :
6887 passphrase : ${{ secrets.IBAS_PROD_PASSWORD }}
6988 # port: ${{ secrets.PORT }} # default : 22
7089 script : |
71- bash ${{ secrets.IBAS_PROD_DEPLOY_PATH }}/deploy.sh
90+ bash ${{ secrets.IBAS_PROD_DEPLOY_PATH }}/deploy.sh
91+
92+ - name : Remove GitHub IP from Security Group
93+ if : always()
94+ run : |
95+ aws ec2 revoke-security-group-ingress \
96+ --group-id ${{ secrets.AWS_SECURITY_GROUP_ID }} \
97+ --protocol tcp \
98+ --port 22 \
99+ --cidr ${{ steps.ip.outputs.ipv4 }}/32
You can’t perform that action at this time.
0 commit comments