Skip to content

Commit e576844

Browse files
committed
ci: Derive deploy environment from the branch ref
Select the environment from github.ref rather than the event type, so a workflow_dispatch off a feature branch resolves to preview instead of production. Production is only reached from the default branch.
1 parent 4e95639 commit e576844

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/deploy-website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2525

2626
environment:
27-
name: stockindicators.dev
27+
name: ${{ github.ref == 'refs/heads/main' && 'stockindicators.dev' || 'preview' }}
2828
url: ${{ steps.deploy.outputs.pages-deployment-alias-url }}
2929

3030
steps:

0 commit comments

Comments
 (0)