File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 12
12
uses : actions/checkout@v4
13
13
with :
14
14
fetch-depth : 1
15
+ - name : Calculate short hash
16
+ run : |
17
+ shortHash=$(git rev-parse --short ${{ github.sha }})
18
+ echo "COMMIT_SHORT_SHA=$hash" >> $GITHUB_ENV
15
19
- name : SSH setup and run commands
16
20
uses : appleboy/ssh-action@v1.0.3
17
21
with :
23
27
cd ./deploy/${{ github.event.repository.name }}
24
28
git pull
25
29
docker rm --force ${{ github.event.repository.name }}-deploy || true
26
- docker build -t ${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}:$(git rev-parse --short HEAD) --quiet .
27
- docker run --detach --name ${{ github.event.repository.name }}-deploy ${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}:$(git rev-parse --short HEAD)
30
+ docker build -t ${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}:${{ env.COMMIT_SHORT_SHA }} --quiet .
31
+ docker run --detach --name ${{ github.event.repository.name }}-deploy ${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}:${{ env.COMMIT_SHORT_SHA }}
28
32
docker container prune --force && docker image prune --all --force
You can’t perform that action at this time.
0 commit comments