-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Deploying the primer.style website with a github action instead of vercel-bot #1303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
01a8f82
Add deploy action
jonrohan 8b4ce08
ubuntu
jonrohan 5a89ab6
Try creating a deployment status
jonrohan bcfdf64
environment_url
jonrohan d6f3282
test file count
jonrohan cb14b94
check count
jonrohan b61b8b1
check 0
jonrohan c79d892
putting it together
jonrohan 120cdfe
Split into 2 deploy files
jonrohan 8e3aab0
Merge branch 'main' into vercel_action
jonrohan 97cd9ee
Merge branch 'main' into vercel_action
jonrohan 6fe622d
We don't need to update status because there's no pr and we don't use…
jonrohan bccf54f
try getting existing deployments
jonrohan b618810
github.actions
jonrohan 00d524f
Create deployment
jonrohan f7a8b7d
preview-docs
jonrohan f018ea5
Use the sha
jonrohan 46898c0
Remove transient info
jonrohan 22957e2
revert back
jonrohan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Deploy | ||
| on: | ||
| push: | ||
| branches-ignore: | ||
| - main | ||
| paths: | ||
| - 'src/**' | ||
| - 'docs/**' | ||
| - '.github/workflows/deploy*.yml' | ||
| - 'package.json' | ||
| jobs: | ||
| deploy-preview: | ||
| if: ${{ github.repository == 'primer/css' }} | ||
| name: Preview | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@master | ||
| - uses: chrnorm/deployment-action@releases/v1 | ||
| name: Create GitHub deployment | ||
| id: deployment | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| environment: Preview | ||
|
|
||
| - name: Vercel Action | ||
| uses: amondnet/vercel-action@v20.0.0 | ||
| id: vercel-action | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| vercel-token: ${{ secrets.VERCEL_TOKEN_SHARED }} | ||
| github-comment: false | ||
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID_SHARED }} | ||
| vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | ||
|
|
||
| - name: Update deployment status (success) | ||
| if: success() | ||
| uses: chrnorm/deployment-status@releases/v1 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| environment_url: ${{ steps.vercel-action.outputs.preview-url }} | ||
| state: "success" | ||
| deployment_id: ${{ steps.deployment.outputs.deployment_id }} | ||
|
|
||
| - name: Update deployment status (failure) | ||
| if: failure() | ||
| uses: chrnorm/deployment-status@releases/v1 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| state: "failure" | ||
| deployment_id: ${{ steps.deployment.outputs.deployment_id }} | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: Deploy | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'src/**' | ||
| - 'docs/**' | ||
| - '.github/workflows/deploy*.yml' | ||
| - 'package.json' | ||
| jobs: | ||
| deploy: | ||
| if: ${{ github.repository == 'primer/css' }} | ||
| name: Production | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@master | ||
|
|
||
| # Check the number of changeset files, if it's 0 we deploy | ||
| - id: changeset-count | ||
| run: echo "::set-output name=CHANGE_COUNT::$(ls .changeset/*.md | grep -v README | wc -l | xargs)" | ||
|
|
||
| - if: ${{ steps.changeset-count.outputs.CHANGE_COUNT == 0 }} | ||
| name: Vercel Action | ||
| uses: amondnet/vercel-action@v20.0.0 | ||
| id: vercel-action | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| vercel-token: ${{ secrets.VERCEL_TOKEN_SHARED }} | ||
| vercel-args: '--prod' | ||
| github-comment: false | ||
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID_SHARED }} | ||
| vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -26,6 +26,6 @@ | |
| } | ||
| ], | ||
| "github": { | ||
| "silent": true | ||
| "enabled": false | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we don't want vercel to make a github comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was extra noise we didn't really need since there's deployment statuses in the PR also. but that's my personal preference, I'm open to others thoughts. We also have the option to put custom content in here.