Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

Commit 5aba860

Browse files
committed
updated
1 parent 30668b4 commit 5aba860

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

.github/workflows/deploy.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
3232
aws-region: ap-northeast-2
3333

34+
- name: Delete old artifact from S3
35+
run: |
36+
aws s3 rm s3://$S3_BUCKET/$S3_KEY || true
37+
3438
- name: Upload artifact to S3
3539
run: |
3640
aws s3 cp dist.zip s3://$S3_BUCKET/$S3_KEY

appspec.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ hooks:
2424
- location: scripts/start_server.sh
2525
timeout: 60
2626
runas: ubuntu
27+
28+
ValidateService:
29+
- location: scripts/validate_service.sh
30+
timeout: 60
31+
runas: ubuntu

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ const app = express()
33
const port = process.env.PORT || 3000
44

55
app.get('/', (req, res) => {
6-
res.send('Hello World!')
6+
res.send('Hello World! (CodeDeploy Example)')
77
})
88

99
app.get('/health', (req, res) => {
1010
res.json({
1111
status: 'OK',
12-
version: '1.0.0',
12+
version: '2.0.0',
1313
})
1414
})
1515

scripts/validate_service.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
echo "Validating application..."
3+
curl -f http://localhost:3000/health || exit 1

0 commit comments

Comments
 (0)