-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (37 loc) · 1.21 KB
/
deploy.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
name: Build and Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
# platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
tags: backroad-docs:latest
outputs: type=docker,dest=/tmp/backroad-docs.tar
cache-from: type=gha
cache-to: type=gha,mode=max
- run: ls -la /tmp
- run: whoami
- name: use ssh agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SUDOMAKES_KEY }}
- name: do ssh
env:
HOST: ${{ secrets.SUDOMAKES_HOSTNAME }}
USER: ${{ secrets.SUDOMAKES_USER }}
PORT: ${{ secrets.SUDOMAKES_PORT }}
run: |
scp -o StrictHostKeyChecking=no -P $PORT /tmp/backroad-docs.tar $USER@$HOST:/tmp
ssh -o StrictHostKeyChecking=no -p $PORT $USER@$HOST 'ls -la /tmp/ && docker load --input /tmp/backroad-docs.tar'