-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (56 loc) · 1.99 KB
/
deploy.yaml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Build & Deploy
on:
push:
branches:
- master
workflow_dispatch:
concurrency:
group: deployment
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
name: Build & Deploy to dev
environment:
name: dev
url: https://dev.imperaonline.de
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
name: Set up Docker Buildx
id: buildx
- run: docker build -t impera-frontend:latest -t impera-frontend:${{ github.sha }} .
- run: docker save impera-frontend:latest -o impera-frontend.tar
- name: Copy container to server
uses: garygrossgarten/github-action-scp@dba89d858413133b6e35da91a3c989cc8cde3ad4
with:
local: impera-frontend.tar
remote: /images/impera-frontend.tar
host: 217.160.244.154
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASS }}
- name: Import image & use for dev
uses: garygrossgarten/github-action-ssh@2b10f41b5a33808f6d24eafd253296766308b7c4
with:
command: |
docker load -i /images/impera-frontend.tar
docker-compose -p impera-frontend -f /images/docker-compose-impera-frontend.yml up -d --remove-orphans
host: 217.160.244.154
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASS }}
prod:
runs-on: ubuntu-latest
needs: [build]
environment:
name: production
url: https://www.imperaonline.de
steps:
- name: Tag image and restart prod container
uses: garygrossgarten/github-action-ssh@2b10f41b5a33808f6d24eafd253296766308b7c4
with:
command: |
docker tag impera-frontend:latest impera-frontend:production
docker-compose -p impera-frontend -f /images/docker-compose-impera-frontend.yml up -d --remove-orphans
host: 217.160.244.154
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASS }}