-
-
Notifications
You must be signed in to change notification settings - Fork 10
33 lines (26 loc) · 1.16 KB
/
deploy_v2.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
name: Build & Deploy Domino
on:
push:
branches: [ developer ]
jobs:
build:
name: Build Web
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
set-safe-directory: false
- name: Login Docker
run: docker login -u "eufelipemateus" -p "${{secrets.DOCKER_TOKEN}}"
- name: Build
run: docker build -t ${{ github.repository_owner }}/${{ github.event.repository.name }}:test -f ./docker/Dockerfile . # tag ${{ github.head_ref || github.ref_name }}
- name: Push docker
run: docker push ${{ github.repository_owner }}/${{ github.event.repository.name }}:test # tag ${{ github.head_ref || github.ref_name }}
- name: Write SSH keys
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{secrets.SSH_HOST}} > ~/.ssh/known_hosts
- name: Deploy with rsync
run: rsync -rav --delete ./ ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}}:${{secrets.WORK_DIR}}