-
Notifications
You must be signed in to change notification settings - Fork 20
28 lines (28 loc) · 1.05 KB
/
deploy.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
# Deploys the current branch to Kelvin using a webhook.
# The authorization token and the URL of the webhook are configured through
# GHA environment secrets `ENV_DEPLOY_TOKEN` and `ENV_DEPLOY_URL`, respectively.
name: Deploy
on:
workflow_dispatch:
push:
branches:
- master
jobs:
# Determine into which environment should this branch be deployed
# master => "production"
# other branch => "kelvin2"
setup:
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.production.outputs.environment }}
steps:
- id: production
run: echo "environment=${{ github.ref_name == 'master' && 'production' || 'kelvin2' }}" >> $GITHUB_OUTPUT
deploy:
needs: setup
runs-on: ubuntu-latest
concurrency: ${{ needs.setup.outputs.environment }}
environment: ${{ needs.setup.outputs.environment }}
steps:
- run: echo "Deploying to environment ${{ needs.setup.outputs.environment }}"
- run: 'curl --fail --silent --show-error -H"Authorization: Bearer ${{ secrets.ENV_DEPLOY_TOKEN }}" ${{ secrets.ENV_DEPLOY_URL }}'