-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
5 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,7 @@ jobs: | |
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Calculate short hash | ||
run: | | ||
shortHash=$(git rev-parse --short ${{ github.sha }}) | ||
echo "COMMIT_SHORT_SHA=$shortHash" >> $GITHUB_ENV | ||
|
||
- name: SSH setup and run commands | ||
uses: appleboy/[email protected] | ||
with: | ||
|
@@ -26,7 +21,6 @@ jobs: | |
script: | | ||
cd ./deploy/${{ github.event.repository.name }} | ||
git pull | ||
docker rm --force ${{ github.event.repository.name }}-deploy 2> /dev/null | ||
docker build -t ${{ github.repository }}:${{ env.COMMIT_SHORT_SHA }} --quiet . | ||
docker run --detach --publish 5000:5000 --name ${{ github.event.repository.name }}-deploy ${{ github.repository }}:${{ env.COMMIT_SHORT_SHA }} | ||
docker container prune --force && docker image prune --all --force | ||
docker rm -f ${{ github.event.repository.name }} || true | ||
docker build -t ${{ github.repository }} . | ||
docker run -d -p 5000:5000 --name ${{ github.event.repository.name }} ${{ github.repository }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters