Update testworkflow.yml #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
default: Development | |
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)" |