-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show deploy button in GitHub Actions tab
- Loading branch information
1 parent
93eeb00
commit dbf70a2
Showing
1 changed file
with
39 additions
and
39 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
name: Vercel Deploy | ||
on: [push] | ||
name: Deploy Vercel | ||
on: [ push, workflow_dispatch ] | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Extract branch name | ||
id: extract_branch | ||
run: | | ||
branch_name=${GITHUB_REF#refs/heads/} | ||
branch_formatted=${branch_name//\//-} | ||
echo $branch_name | ||
echo $branch_formatted | ||
echo ::set-output name=branch::$branch_formatted | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Extract branch name | ||
id: extract_branch | ||
run: | | ||
branch_name=${GITHUB_REF#refs/heads/} | ||
branch_formatted=${branch_name//\//-} | ||
echo $branch_name | ||
echo $branch_formatted | ||
echo ::set-output name=branch::$branch_formatted | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Deploy to Staging | ||
id: deploy-vercel-staging | ||
uses: amondnet/vercel-action@v20 | ||
if: github.ref != 'refs/heads/main' | ||
with: | ||
vercel-token: ${{secrets.VERCEL_TOKEN}} | ||
github-token: ${{secrets.VERCEL_GITHUB_TOKEN}} | ||
vercel-org-id: ${{secrets.VERCEL_ORG_ID}} | ||
vercel-project-id: ${{secrets.VERCEL_PROJECT_ID}} | ||
alias-domains: >- | ||
${{ format( | ||
'{0}-{1}.vercel.app', | ||
secrets.VERCEL_DOMAIN, | ||
steps.extract_branch.outputs.branch) | ||
}} | ||
- name: Deploy to Production | ||
id: deploy-vercel-production | ||
uses: amondnet/vercel-action@v20 | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
vercel-token: ${{secrets.VERCEL_TOKEN}} | ||
vercel-org-id: ${{secrets.VERCEL_ORG_ID}} | ||
vercel-project-id: ${{secrets.VERCEL_PROJECT_ID}} | ||
vercel-args: '--prod' | ||
- name: Deploy to Staging | ||
id: deploy-vercel-staging | ||
uses: amondnet/vercel-action@v20 | ||
if: github.ref != 'refs/heads/main' | ||
with: | ||
vercel-token: ${{secrets.VERCEL_TOKEN}} | ||
github-token: ${{secrets.VERCEL_GITHUB_TOKEN}} | ||
vercel-org-id: ${{secrets.VERCEL_ORG_ID}} | ||
vercel-project-id: ${{secrets.VERCEL_PROJECT_ID}} | ||
alias-domains: >- | ||
${{ format( | ||
'{0}-{1}.vercel.app', | ||
secrets.VERCEL_DOMAIN, | ||
steps.extract_branch.outputs.branch) | ||
}} | ||
- name: Deploy to Production | ||
id: deploy-vercel-production | ||
uses: amondnet/vercel-action@v20 | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
vercel-token: ${{secrets.VERCEL_TOKEN}} | ||
vercel-org-id: ${{secrets.VERCEL_ORG_ID}} | ||
vercel-project-id: ${{secrets.VERCEL_PROJECT_ID}} | ||
vercel-args: '--prod' |