Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
fix: npmじゃなくてyarnでした (#212)
Browse files Browse the repository at this point in the history
* fix: npmじゃなくてyarnでした

* ci: ビルドとデプロイを別ジョブ化

* ci: fix build & generate

* ci: fix name
  • Loading branch information
book000 authored Jun 16, 2023
1 parent 3013ca1 commit ab9fcbd
Showing 1 changed file with 43 additions and 12 deletions.
55 changes: 43 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,19 @@ permissions:
# default pull-requests: read & write (in forked repos, only read)
pull-requests: write

# Cancel previous runs that are not completed yet
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Deploy
deploy:
name: Deploy
# Build
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10

# push event in main branch
# workflow_dispatch event
# pull_request event from not forked repo
Expand All @@ -46,12 +53,6 @@ jobs:
(github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.fork == true && contains(github.event.label.name, '🚀request-deploy'))
}}

# Cancel previous runs that are not completed yet
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref }}
cancel-in-progress: true
timeout-minutes: 10

steps:
- name: Checkout jaoafa/jaoweb
uses: actions/checkout@v3
Expand Down Expand Up @@ -94,10 +95,40 @@ jobs:
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
run: yarn

- name: Build
run: yarn cross-env NUXT_TELEMETRY_DISABLED=1 nuxt build

- name: Generate
run: yarn cross-env NUXT_TELEMETRY_DISABLED=1 nuxt generate

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist

- name: Run generate
run: npm run generate
# Deploy
deploy:
name: Deploy
runs-on: ubuntu-latest
timeout-minutes: 5

needs:
- build

steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist
path: dist

- name: Publish to Cloudflare Pages
id: cloudflare-pages-deploy
Expand Down

1 comment on commit ab9fcbd

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡ Successfully Cloudflare Pages deployed!

Name Link
🔨 Latest commit ab9fcbd
🔍 Latest deploy log https://github.com/jaoafa/jaoweb-docs/actions/runs/5289218307
😎 Deploy Preview Url https://7722f6c3.jaoweb-docs.pages.dev
🌳 Environment production

Please sign in to comment.