forked from broamski/aws-mfa
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 1.33 KB
/
testworkflow.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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Mock deploy workflow
on:
#push:
# branches: [ "master" ]
#pull_request:
# branches: [ "master" ]
workflow_dispatch:
inputs:
deployment_type:
description: 'Type of deployment'
required: true
type: choice
options:
- Development
- Test
- Staging
- Production
env:
LOG_LEVEL: |
${{ fromJson('{ Development: "DEBUG", Production: "INFO" }')[github.event.inputs.deployment_type] }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Build
run: echo 'Build some stuff'
- name: Test
run: echo 'Testing some stuff'
deploy:
runs-on: ubuntu-latest
needs: build
environment: ${{ github.event.inputs.deployment_type }}
steps:
- name: Output deploy type
run: echo 'Deploy type';echo '${{ github.event.inputs.deployment_type }}'
- name: Mock environmment deploy
run: echo "Deploy to ${{ vars.ACCOUNT_ID }} with log level $LOG_LEVEL. Shhh the secret is ${{ secrets.SECRET_PASSWORD_TEST }} (GitHub obsfucates this)"