Skip to content

Commit

Permalink
refactor(deploy.yml): deploy to netlify (apache#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyeYoung authored May 11, 2022
1 parent 39b7d1c commit c31dffd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/actions/actions-netlify
Submodule actions-netlify added at c5879c
21 changes: 19 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Test and Deploy Website
on:
push:
branches: [master]
pull_request:
pull_request_target:
branches: [master]
schedule:
# Run everyday at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07)
Expand All @@ -24,6 +24,9 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
with:
submodules: recursive

- uses: actions/setup-node@v3
with:
node-version: "14"
Expand Down Expand Up @@ -64,7 +67,7 @@ jobs:

- name: Sync documents
run: |
yarn sync-doc && yarn generate-repos-info && git status
yarn prepare-data && git status
- name: Apply docusaurus cache
id: docusaurus-cache
Expand All @@ -84,6 +87,20 @@ jobs:
run: |
yarn update-sitemap && git status
- name: Deploy to Netlify
uses: ./.github/actions/actions-netlify
with:
publish-dir: "./website/build"
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "${{ github.event.pull_request.title }}, Deploy from GitHub Actions"
enable-pull-request-comment: true
enable-commit-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 10

- name: Deploy
uses: peaceiris/[email protected]
if: github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event_name == 'schedule'
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".github/actions/actions-netlify"]
path = .github/actions/actions-netlify
url = https://github.com/nwtgck/actions-netlify.git

0 comments on commit c31dffd

Please sign in to comment.