-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (67 loc) · 1.81 KB
/
prod-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
67
68
69
70
71
name: "Prod Deploy"
on:
workflow_dispatch:
inputs:
TAG:
description: "Tag to Deploy"
type: string
required: true
default: "latest"
#BUILD:
# description: "Build Image"
# type: boolean
# required: true
# default: true
#DEPLOY:
# description: "Deploy Image"
# type: boolean
# required: true
# default: true
CLEANUP:
description: "Run Cleanup"
type: boolean
required: true
default: true
repository_dispatch:
types:
- webhook
#push:
# branches:
# - master
jobs:
build:
name: "Build"
uses: ./.github/workflows/build.yaml
#if: ${{ inputs.BUILD != '' && inputs.BUILD || true }}
permissions:
contents: read
packages: write
with:
GHCR_TAG: ${{ inputs.TAG != '' && inputs.TAG || 'latest' }}
GHCR_URI: "ghcr.io/${{ github.repository }}"
GHCR_USER: ${{ vars.GHCR_USER }}
secrets:
GHCR_PASS: ${{ secrets.GHCR_PASS }}
deploy:
name: "Deploy"
uses: ./.github/workflows/deploy.yaml
needs: build
#if: ${{ inputs.DEPLOY != '' && inputs.DEPLOY || true }}
permissions:
contents: read
with:
GHCR_TAG: ${{ inputs.TAG != '' && inputs.TAG || 'latest' }}
STACK_NAME: prod_django5-boiler
STACK_FILE: docker-compose-swarm.yaml
CONFIG_FILE: services/shane/django5-boiler/prod.env
secrets:
SERVICE_CONFIGS_KEY: ${{ secrets.SERVICE_CONFIGS_KEY }}
PORTAINER_URL: ${{ secrets.PORTAINER_URL }}
PORTAINER_TOKEN: ${{ secrets.PORTAINER_TOKEN }}
cleanup:
name: "Cleanup"
uses: ./.github/workflows/cleanup.yaml
needs: deploy
if: ${{ inputs.CLEANUP != '' && inputs.CLEANUP || true }}
secrets:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}