-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.62 KB
/
manual-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
name: Manual Deployment with tags
on:
workflow_dispatch:
inputs:
deployment:
description: "Type of deployment"
required: true
default: "full"
type: choice
options:
- "full-deployment"
- "hot-upgrade"
jobs:
create-tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.save-tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Capture GITHUB_SHORT_SHA
run: |
GITHUB_SHORT_SHA=$(git rev-parse --short ${{ github.sha }})
echo "GITHUB_SHORT_SHA=${GITHUB_SHORT_SHA}" >> $GITHUB_ENV
- name: Capture and update project mix version
id: save-tag
run: |
MIX_VERSION=`grep "version:" mix.exs | awk -F'"' '{print $2}'`
PROJ_TAG=${MIX_VERSION}-${GITHUB_SHORT_SHA}
echo "PROJ_TAG=${PROJ_TAG}" >> $GITHUB_ENV
echo "tag=$PROJ_TAG" >> "$GITHUB_OUTPUT"
echo "Creating the tag: $PROJ_TAG"
- uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: ${{ env.PROJ_TAG }}
message: "Created ${{ inputs.deployment }} tag ${{ env.PROJ_TAG }}"
deploy-full-deployment:
if: inputs.deployment == 'full-deployment'
needs: create-tag
uses: ./.github/workflows/full-deployment.yaml
with:
tag: ${{ needs.create-tag.outputs.tag }}
secrets: inherit
deploy-hot-upgrade:
if: inputs.deployment == 'hot-upgrade'
needs: create-tag
uses: ./.github/workflows/hot-upgrade.yaml
with:
tag: ${{ needs.create-tag.outputs.tag }}
secrets: inherit