Add new pipeline step to set environment variable before deploying to server. Include newly added deploy_env.json file specifying deployment environment as 'development'.

This commit is contained in:
Andreas Hnida 2024-04-17 21:50:24 +02:00
commit 0be583ff98
2 changed files with 10 additions and 1 deletions

View file

@ -10,7 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- name: Set Environment
id: set-env
run: |
echo "ENV=$(cat deploy_env.json | jq -r '.env')" >> $GITHUB_ENV
echo "::set-output name=environment::$ENV"
- name: Set up Go
uses: actions/setup-go@v5.0.0
with:
@ -53,6 +58,7 @@ jobs:
run: hugo --minify
- name: Deploy to Server
if: ${{ github.job.outputs.environment == 'development' }}
uses: SamKirkland/FTP-Deploy-Action@4.0.0
with:
protocol: ftps

3
deploy_env.json Normal file
View file

@ -0,0 +1,3 @@
{
"env": "development"
}