-
Notifications
You must be signed in to change notification settings - Fork 9
48 lines (43 loc) · 1.27 KB
/
docker.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
41
42
43
44
45
46
47
48
name: Build & Deploy
on:
# Manually triggered from the UI
workflow_dispatch:
inputs:
environment:
description: "Environment"
required: true
type: environment
# Dependency to a forking workflow
#workflow_run:
# workflows: ["Django CI"]
# types: [completed]
jobs:
build_docker:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
concurrency: ${{ github.event.inputs.environment }}
steps:
- uses: actions/checkout@v3
- name: Login to packages container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: |
make build-docker-image
make tag-${{ github.event.inputs.environment }}
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: maaa-registration
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
proxy_host: ${{ secrets.SSH_HOST }}
proxy_username: ${{ secrets.SSH_USERNAME }}
proxy_key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /opt/docker
docker-compose pull
docker-compose up -d