CI: combine build and deploy into single job
Some checks failed
Build & Deploy / build (push) Has been cancelled
Some checks failed
Build & Deploy / build (push) Has been cancelled
This commit is contained in:
@@ -14,20 +14,15 @@ jobs:
|
|||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: docker build -t barotrauma-server:${{ github.sha }} .
|
run: docker build -t barotrauma-server:${{ github.sha }} .
|
||||||
|
|
||||||
deploy:
|
|
||||||
if: github.ref_name == 'release'
|
|
||||||
runs-on: [ ubuntu-22.04 ]
|
|
||||||
needs: build
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Tag and push to local registry
|
- name: Tag and push to local registry
|
||||||
|
if: github.ref_name == 'release'
|
||||||
run: |
|
run: |
|
||||||
docker tag barotrauma-server:${{ github.sha }} \
|
docker tag barotrauma-server:${{ github.sha }} \
|
||||||
${{ secrets.REGISTRY_ADDR }}/barotrauma-server:latest
|
${{ secrets.REGISTRY_ADDR }}/barotrauma-server:latest
|
||||||
docker push ${{ secrets.REGISTRY_ADDR }}/barotrauma-server:latest
|
docker push ${{ secrets.REGISTRY_ADDR }}/barotrauma-server:latest
|
||||||
|
|
||||||
- name: Deploy via SSH
|
- name: Deploy via SSH
|
||||||
|
if: github.ref_name == 'release'
|
||||||
uses: appleboy/ssh-action@v1
|
uses: appleboy/ssh-action@v1
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.SERVER_HOST }}
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
|
|||||||
Reference in New Issue
Block a user