Skip to content

Commit 45457a4

Browse files
fix more issues with env and github url
1 parent c10dd00 commit 45457a4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Send slack message with github commit url
2929
run: >
3030
curl -X POST -H 'Content-type: application/json'
31-
--data '{"text":":rocket: Deployment started for commit: ${{ github.event.head_commit.message }} - https://${{ github.repository }}/commit/${{ github.sha }}"}'
31+
--data '{"text":":rocket: Deployment started for commit: ${{ github.event.head_commit.message }} - https://github.com/${{ github.repository }}/commit/${{ github.sha }}"}'
3232
${{ env.SLACK_WEBHOOK_URL }}
3333
- name: JDK
3434
if: ${{ github.event.inputs.build_number == '' }}
@@ -71,14 +71,14 @@ jobs:
7171
run: |
7272
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\":hammer_and_wrench: Building and deploying $IMAGE to Docker Hub...\"}" ${{ env.SLACK_WEBHOOK_URL }}
7373
mvn -B -ntp clean verify jib:build -Ddocker.image.tag=$BUILD_NUMBER
74-
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\":white_check_mark: Successfully built and pushed $IMAGE to Docker Hub\"}" ${{ env.SLACK_WEBHOOK_URL }}
74+
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\":white_check_mark: Successfully built and pushed ${{ env.IMAGE }} to Docker Hub\"}" ${{ env.SLACK_WEBHOOK_URL }}
7575
- name: Setup SSH Agent
7676
uses: webfactory/[email protected]
7777
with:
7878
ssh-private-key: ${{ env.EC2_SSH_PRIVATE_KEY }}
7979
- name: SSH To EC2 and Deploy
8080
run: |
81-
curl -X POST -H 'Content-type: application/json' --data '{"text":":cloud: Deploying $IMAGE to AWS EC2..."}' ${{ env.SLACK_WEBHOOK_URL }}
81+
curl -X POST -H 'Content-type: application/json' --data '{"text":":cloud: Deploying ${{ env.IMAGE }} to AWS EC2..."}' ${{ env.SLACK_WEBHOOK_URL }}
8282
ssh -o StrictHostKeyChecking=no ec2-user@$EC2_PUBLIC_IP_ADDRESS << EOF
8383
cd ~
8484
sed -i 's|image: '"$DOCKER_USERNAME"'/'"$DOCKER_IMAGE_NAME"':.*$|image: '"$DOCKER_USERNAME"'/'"$DOCKER_IMAGE_NAME"':'"$BUILD_NUMBER"'|' docker-compose.yml
@@ -88,7 +88,7 @@ jobs:
8888
docker ps
8989
echo "$BUILD_NUMBER" > build-number.txt
9090
EOF
91-
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\":tada: Successfully deployed $IMAGE to AWS EC2\"}" ${{ env.SLACK_WEBHOOK_URL }}
91+
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\":tada: Successfully deployed ${{ env.IMAGE }} to AWS EC2\"}" ${{ env.SLACK_WEBHOOK_URL }}
9292
- name: Send slack message with status
9393
if: always()
9494
run: |

0 commit comments

Comments
 (0)