-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (45 loc) · 2.01 KB
/
test-env-vars-complex.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
53
name: Deploy Assets
on:
workflow_dispatch:
inputs:
server:
description: 'Server to deploy to (staging|test|prod)'
required: true
default: 'staging'
jobs:
build:
runs-on: ubuntu-latest
env:
GIT_TERMINAL_PROMPT: 0
# Ugly workarounds for env variables conditionals - see https://github.community/t/possible-to-use-conditional-in-the-env-section-of-a-job/135170
WEB_KUDU_PATH: ${{ github.event.inputs.server == 'staging' && secrets.WEB_STAGING_KUDU_PATH || secrets.WEB_TEST_KUDU_PATH }}
WEB_KUDU_USERNAME: ${{ github.event.inputs.server == 'staging' && secrets.WEB_STAGING_KUDU_USERNAME || secrets.WEB_TEST_KUDU_USERNAME }}
WEB_KUDU_PASSWORD: ${{ github.event.inputs.server == 'staging' && secrets.WEB_STAGING_KUDU_PASSWORD || secrets.WEB_TEST_KUDU_PASSWORD }}
WEB_KUDU_PATH_2: ${{ secrets[ }}
DEPLOYMENT_ENV: job_staging
steps:
- if: ${{ github.event.inputs.server == 'test' }}
shell: pwsh
run: |
echo "DEPLOYMENT_ENV=${{ env.DEPLOYMENT_ENV}}" >> $GITHUB_ENV
echo "Running on test (${{ env.DEPLOYMENT_ENV }}) environment"
- if: ${{ github.event.inputs.server == 'staging' }}
shell: pwsh
run: |
echo "DEPLOYMENT_ENV=${{ env.DEPLOYMENT_ENV }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "Running on staging (${{ env.DEPLOYMENT_ENV }}) environment"
# echo "DEPLOYMENT_ENV=${{ env.DEPLOYMENT_ENV }}" >> $GITHUB_ENV
- if: ${{ github.event.inputs.server == 'prod' }}
shell: pwsh
run: |
echo "DEPLOYMENT_ENV=${{ env.DEPLOYMENT_ENV }}" >> $GITHUB_ENV
echo 'Running on prod (${{ env.DEPLOYMENT_ENV }})' environment"
echo 'Running on prod (${{ env.WEB_KUDU_USERNAME }})' environment"
- uses: actions/checkout@v1
name: checkout
- shell: pwsh
run: |
echo "${{ env.DEPLOYMENT_ENV }}"
- shell: pwsh
run: |
echo "${{ env.DEPLOYMENT_ENV }}"