-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (45 loc) · 1.26 KB
/
demo.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
#
# this runs against a pre-configured project and environment
# containing some configuration and secrets that are named
# CTTEST_* and cttest.*
#
name: 'demo'
on:
pull_request: {}
push:
branches:
- 'release/*'
tags:
- 'v*'
jobs:
secrets-gate:
runs-on: ubuntu-latest
outputs:
ok: ${{ steps.check-secrets.outputs.ok }}
steps:
- name: check for secrets needed to run demo
id: check-secrets
run: |
if [ ! -z "${{ secrets.CLOUDTRUTH_API_KEY }}" ]; then
echo "ok=true" >>$GITHUB_OUTPUT
fi
demo:
needs:
- secrets-gate
if: ${{ needs.secrets-gate.outputs.ok == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: cloudtruth/configure-action@v2
with:
apikey: "${{ secrets.CLOUDTRUTH_API_KEY }}"
project: "${{ github.repository }}"
environment: staging
- name: demonstrate secrets redaction
run: |
echo CTTEST_NOT_A_SECRET=${CTTEST_NOT_A_SECRET}
echo CTTEST_TOTALLY_A_SECRET=${CTTEST_TOTALLY_A_SECRET}
[ ! -z "${CTTEST_NOT_A_SECRET}" ] || exit 1
[ ! -z "${CTTEST_TOTALLY_A_SECRET}" ] || exit 1
- name: dump the environment
run: |
printenv | sort