Skip to content

Commit

Permalink
new deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
lusv committed Jan 29, 2024
1 parent d5140a6 commit 4c7c315
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
File renamed without changes.
51 changes: 51 additions & 0 deletions .github/workflows/aws-lightsail-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy to Amazon ECS

on:
push:
branches:
- main

env:
AWS_REGION: us-east-2 # set this to your preferred AWS region, e.g. us-west-1

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: version

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: create next tag
id: semver
uses: jefflinse/pr-semver-bump@v1
with:
mode: bump
major-label: major
minor-label: minor
patch-label: patch
with-v: true
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: bump package.json version
uses: reedyuk/npm-version@1.1.1
with:
version: ${{ steps.semver.outputs.version }}

- name: commit files
uses: EndBug/add-and-commit@v9.0.0
with:
message: update version to ${{ steps.semver.outputs.version }}
default_author: github_actions

- name: Set up SSH connection
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.LIGHTSAIL_SSH_KEY }}

- name: Deploy to Lightsail
run: |
ssh -o "StrictHostKeyChecking=no" ubuntu@3.132.37.247 "cd /home/ubuntu/auth-app-backend && git pull && docker-compose up --build -d"
1 change: 1 addition & 0 deletions src/api/health/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const router = express.Router()
router.get('/', (req, res) => {
res.send({
resultCode: resultCodes.SUCCESS,
message: 'connection OK',
})
})
module.exports = router

0 comments on commit 4c7c315

Please sign in to comment.