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:
parent
e8484f3456
commit
0be583ff98
2 changed files with 10 additions and 1 deletions
|
|
@ -10,7 +10,12 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.4.0
|
- 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
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5.0.0
|
uses: actions/setup-go@v5.0.0
|
||||||
with:
|
with:
|
||||||
|
|
@ -53,6 +58,7 @@ jobs:
|
||||||
run: hugo --minify
|
run: hugo --minify
|
||||||
|
|
||||||
- name: Deploy to Server
|
- name: Deploy to Server
|
||||||
|
if: ${{ github.job.outputs.environment == 'development' }}
|
||||||
uses: SamKirkland/FTP-Deploy-Action@4.0.0
|
uses: SamKirkland/FTP-Deploy-Action@4.0.0
|
||||||
with:
|
with:
|
||||||
protocol: ftps
|
protocol: ftps
|
||||||
|
|
|
||||||
3
deploy_env.json
Normal file
3
deploy_env.json
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"env": "development"
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue