-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.02 KB
/
staging.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
51
52
name: Deploy to staging
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
version:
required: false
type: string
repository_dispatch:
inputs:
version:
required: false
type: string
concurrency:
group: staging
cancel-in-progress: true
jobs:
prepare:
name: Prepare deployment
runs-on: ubuntu-latest
outputs:
version: ${{ steps.vars.outputs.version }}
steps:
- name: Compute variables
id: vars
run: |
if [[ ! -z "${{ inputs.version }}" ]]; then
version="${{ inputs.version }}"
elif [[ $GITHUB_REF == refs/tags/* ]]; then
version=${GITHUB_REF/refs\/tags\//}
else
version=${GITHUB_BASE_REF:-${GITHUB_REF#refs/*/}}
fi
echo ::set-output name=version::$version
build:
needs: prepare
uses: au2001/gitops-demo-app/.github/workflows/build.yml@main
with:
prefix: stg-
version: ${{ needs.prepare.outputs.version }}
environment: Staging