-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (44 loc) · 1.45 KB
/
manual-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
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Manual Deploy
on:
workflow_dispatch:
jobs:
meta:
runs-on: ubuntu-latest
outputs:
ENVIRONMENT: ${{ steps.vars.outputs.ENVIRONMENT }}
STACK_NAME: ${{ steps.vars.outputs.STACK_NAME }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Env Vars
id: vars
run: |
ENVIRONMENT=${{ vars.LIVE_ENV }}
echo "ENVIRONMENT=${ENVIRONMENT}" >> $GITHUB_OUTPUT
echo "STACK_NAME=${ENVIRONMENT//./-}" >> $GITHUB_OUTPUT
deploy:
if: ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
needs:
- meta
environment:
name: ${{ needs.meta.outputs.ENVIRONMENT }}
url: ${{ needs.meta.outputs.ENVIRONMENT }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy to cluster
uses: kitconcept/docker-stack-deploy@v1.2.0
with:
registry: "ghcr.io"
username: "ploneorgbr"
password: ${{ secrets.GHCR_TOKEN }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_port: ${{ secrets.DEPLOY_PORT }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_private_key: ${{ secrets.DEPLOY_SSH }}
stack_file: devops/stacks/${{ needs.meta.outputs.ENVIRONMENT }}.yml
stack_name: ${{ needs.meta.outputs.STACK_NAME }}
stack_param: ${{ github.ref_name }}
env_file: ${{ secrets.ENV_FILE }}
deploy_timeout: 480