-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (56 loc) · 1.76 KB
/
Copy pathdeploy.yml
File metadata and controls
66 lines (56 loc) · 1.76 KB
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: Docker Push & re-deploy Fluffy
on:
push:
branches: [ master ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME_DOCKER_HUB: snicki13/fluffy
jobs:
docker:
name: Publish - Docker Hub
runs-on: ubuntu-18.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v1
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USER }}
-p ${{ secrets.DOCKER_PASS }}
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v1.10.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.5.1
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3.5.0
with:
images: ${{ env.IMAGE_NAME_DOCKER_HUB }}, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v2.7.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
name: Redeploy testsystem
runs-on: ubuntu-latest
needs: docker
steps:
- name: Redeploy testsystem via ssh.
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_PRIV_KEY }}
script: dist/restart-fluffy.sh