Skip to content

Commit

Permalink
ci(root): added the deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kurone-kito committed Oct 9, 2024
1 parent 515100e commit e27c9f6
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: The CI workflow on merge as a master branch
run-name: Merged the main branch by @${{ github.actor }}
on:
push:
branches:
- master
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
permissions:
contents: read
pull-requests: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Stages the pushed branch
uses: actions/checkout@v4
- name: Pre-prepare the Node.js environment
uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Enable the corepack because of the pnpm
run: corepack enable
- name: Post-prepare the Node.js environment
uses: actions/setup-node@v4
with:
cache: ${{ !env.ACT && 'pnpm' || '' }}
node-version-file: .node-version
- env:
HUSKY: 0
name: Install the dependencies
run: pnpm install --prefer-frozen-lockfile
- env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
ID_OTHERS: ${{ secrets.ID_OTHERS }}
ID_RELEASE: ${{ secrets.ID_RELEASE }}
ID_STREAMING: ${{ secrets.ID_STREAMING }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
name: Run the build
run: pnpm run build
- env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
name: Deploy to Netlify
# cspell:disable-next-line
uses: nwtgck/actions-netlify@v3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
production-deploy: true
production-branch: master
publish-dir: './packages/web/.output/public'
49 changes: 49 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: The CI workflow on push
on:
push:
branches:
- '*'
- '!master'
permissions:
contents: read
pull-requests: write
jobs:
build:
defaults:
Expand Down Expand Up @@ -56,3 +60,48 @@ jobs:
shell: powershell
fail-fast: false
timeout-minutes: 30
deploy:
name: The staging deploy process
needs: build
runs-on: ubuntu-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Stages the pushed branch
uses: actions/checkout@v4
- name: Pre-prepare the Node.js environment
uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Enable the corepack because of the pnpm
run: corepack enable
- name: Post-prepare the Node.js environment
uses: actions/setup-node@v4
with:
cache: ${{ !env.ACT && 'pnpm' || '' }}
node-version-file: .node-version
- env:
HUSKY: 0
name: Install the dependencies
run: pnpm install --prefer-frozen-lockfile
- env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
ID_OTHERS: ${{ secrets.ID_OTHERS }}
ID_RELEASE: ${{ secrets.ID_RELEASE }}
ID_STREAMING: ${{ secrets.ID_STREAMING }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
name: Run the build
run: pnpm run build
- env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
name: Deploy to Netlify
# cspell:disable-next-line
uses: nwtgck/actions-netlify@v3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
production-deploy: false
publish-dir: './packages/web/.output/public'

0 comments on commit e27c9f6

Please sign in to comment.