Skip to content

Commit 1a8f51c

Browse files
committed
cd
1 parent 120f1e9 commit 1a8f51c

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10+
runs-on: ubuntu-latest
11+
1012
build:
11-
runs-on: ubuntu-latest
1213
needs: analyze
1314

1415
steps:
@@ -30,10 +31,9 @@ jobs:
3031
with:
3132
context: .
3233
push: true
33-
tags: manojkumar8008/javafile:123
34+
tags: manojkumar8008/javafile:1234
3435
analyze:
3536
name: Analyze
36-
runs-on: ubuntu-latest
3737

3838
permissions:
3939
security-events: write # Required for CodeQL to upload results
@@ -59,3 +59,17 @@ jobs:
5959

6060
- name: Perform CodeQL Analysis
6161
uses: github/codeql-action/analyze@v3
62+
deploy:
63+
needs: ["build,analyze"]
64+
steps:
65+
- name: Deploy Docker image on EC2
66+
uses: appleboy/ssh-action@v1.0.3
67+
with:
68+
host: ${{ vars.EC2_HOST }}
69+
username: ${{ vars.EC2_USER }}
70+
key: ${{ secrets.EC2_KEY }}
71+
       script: |
72+
docker pull manojkumar8008/javafile:1234
73+
docker run -d -p 80:8080 manojkumar8008/javafile:1234
74+
75+

0 commit comments

Comments
 (0)