Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
hysong4u committed Aug 24, 2024
2 parents 7545bbc + 3781acc commit 4885dcc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ jobs:
docker build -t huranit-server .
docker tag huranit-server hysong4u/huranit-server:latest
docker push hysong4u/huranit-server:latest
- name: Get timestamp
uses: gerred/actions/current-time@master
id: current-time

- name: Run string replace
uses: frabert/replace-string-action@master
id: format-time
with:
pattern: '[:\.]+'
string: "${{ steps.current-time.outputs.time }}"
replace-with: '-'
flags: 'g'

- name: Deploy to EC2
env:
Expand All @@ -50,6 +63,7 @@ jobs:
docker pull hysong4u/huranit-server:latest
existing_container_id=$(sudo docker ps -q --filter "publish=8081")
[ -n "$existing_container_id" ] && sudo docker stop $existing_container_id && sudo docker rm $existing_container_id
sudo docker image prune -f
docker run -d -p 8081:8081 hysong4u/huranit-server:latest
EOF
Expand Down

0 comments on commit 4885dcc

Please sign in to comment.