-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.11 KB
/
push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Build and Deploy on Push
on:
push:
branches:
- master
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker Image
run: |
COMMIT_HASH=$(echo $GITHUB_SHA | cut -c1-7)
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 \
-t devinfritz/vzbot-discordbot:stage-${COMMIT_HASH} \
-t devinfritz/vzbot-discordbot:stage-latest \
--push .
deploy:
runs-on: ubuntu-latest
needs: build-and-push
steps:
- name: executing remote ssh commands using password
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: github
password: ${{ secrets.SERVER_PASSWORD }}
port: ${{ secrets.SERVER_SSH_PORT }}
script: ./deploy.sh stage