Skip to content

Commit

Permalink
Update vps.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jacky-htg authored Sep 12, 2020
1 parent 315d9c1 commit 2ee2f47
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/vps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:

name: Deploy to VPS

env:
VERSION: $(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')

jobs:
build:
name: Build
Expand All @@ -17,7 +14,9 @@ jobs:
uses: actions/checkout@v2

- name: build docker
run: docker build -t jackyhtg/erp-prod:$VERSION .
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
docker build -t jackyhtg/erp-prod:$VERSION .
deploy:
needs: build
Expand All @@ -30,7 +29,11 @@ jobs:
run: docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: push to docker hub
run: docker push jackyhtg/erp-prod:$VERSION
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
docker push jackyhtg/erp-prod:$VERSION
- name: deploy
run: ssh ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} /root/erp-prod $VERSION
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
ssh ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} /root/erp-prod $VERSION

0 comments on commit 2ee2f47

Please sign in to comment.