Skip to content

Commit

Permalink
Merge pull request #2 from teambit/add-nextjs-health-status
Browse files Browse the repository at this point in the history
Add GHA for Next.js workspace & app creation
  • Loading branch information
leimonio committed Sep 18, 2023
2 parents 57a0bc9 + 33a6772 commit 86d18a3
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/nextjs-bare-starter-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Next.js - Bare Starter - Nightly

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container:
image: bitsrc/ops:latest
env:
HOME: /home/bituser

steps:
- name: Initialize a workspace
run: |
bit
bvm
bvm config set RELEASE_TYPE nightly
bvm upgrade
bit new nextjs my-nextjs-workspace --env teambit.nextjs/nextjs --log error
- name: Check initial status
run: |
cd my-nextjs-workspace
bit list --log error
bit status --log error
bit templates --log error
- name: Create a new app
run: |
cd my-nextjs-workspace
bit create nextjs apps/my-nextjs-app
bit install --log error
bit list --log error
bit use apps/my-nextjs-app
bit app list --log error
bit status --log error
bit run my-nextjs-app &
checkserver http://localhost:3000
- name: Lint & test
run: |
cd my-nextjs-workspace
bit list --log error
bit status --log error
bit lint --log error
bit test --log error
- name: Create a local scope, compile and export
run: |
barescope my-org.my-scope-name my-nextjs-workspace
cd my-nextjs-workspace
bit scope rename org.scope-name my-org.my-scope-name --refactor --log error
bit link --log error
bit compile --log error
bit tag --message "initial tag" --log error
bit export --log error
continue-on-error: false
56 changes: 56 additions & 0 deletions .github/workflows/nextjs-bare-starter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Next.js - Bare Starter

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container:
image: bitsrc/ops:latest
env:
HOME: /home/bituser

steps:
- name: Initialize a workspace
run: |
bit
bvm
bvm upgrade
bit new nextjs my-nextjs-workspace --env teambit.nextjs/nextjs
- name: Check initial status
run: |
cd my-nextjs-workspace
bit list --log error
bit status --log error
bit templates --log error
- name: Create a new app
run: |
cd my-nextjs-workspace
bit create nextjs apps/my-nextjs-app
bit install
bit list
bit use apps/my-nextjs-app
bit app list
bit status
bit run my-nextjs-app &
checkserver http://localhost:3000
- name: Lint and test
run: |
cd my-nextjs-workspace
bit list
bit status
bit lint
bit test
- name: Create a local scope, compile and export
run: |
barescope my-org.my-scope-name my-nextjs-workspace
cd my-nextjs-workspace
bit scope rename org.scope-name my-org.my-scope-name --refactor
bit link
bit compile
bit tag --message "initial tag"
bit export
continue-on-error: false
57 changes: 57 additions & 0 deletions .github/workflows/nextjs-create-app-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Next.js - Bare Starter

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container:
image: bitsrc/ops:latest
env:
HOME: /home/bituser

steps:
- name: Initialize a new workspace
run: |
bit
bvm
bvm config set RELEASE_TYPE nightly
bvm upgrade
bit init my-nextjs-workspace --default-scope my-org.my-scope --log error
- name: Create a Next.js app component
run: |
cd my-nextjs-workspace
bit create nextjs apps/my-nextjs-app --aspect teambit.nextjs/nextjs --log error
bit use apps/my-nextjs-app --log error
- name: Show components, envs and status
run: |
cd my-nextjs-workspace
bit list --log error
bit envs --log error
bit status --log error
- name: Compile, lint, test components
run: |
cd my-nextjs-workspace
bit compile --log error
bit lint --log error
bit test --log error
- name: Run Next.js app component
run: |
cd my-nextjs-workspace
bit run my-nextjs-app --log error &
checkserver http://localhost:3000
- name: Tag components
run: |
cd my-nextjs-workspace
bit tag --message "initial tag" --log error
- name: Create a local scope
run: |
barescope my-org.my-scope my-nextjs-workspace
- name: Export components
run: |
cd my-nextjs-workspace
bit export --log error
continue-on-error: false
56 changes: 56 additions & 0 deletions .github/workflows/nextjs-create-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Next.js - Bare Starter

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container:
image: bitsrc/ops:latest
env:
HOME: /home/bituser

steps:
- name: Initialize a new workspace
run: |
bit
bvm
bvm upgrade
bit init my-nextjs-workspace --default-scope my-org.my-scope --log error
- name: Create a Next.js app component
run: |
cd my-nextjs-workspace
bit create nextjs apps/my-nextjs-app --aspect teambit.nextjs/nextjs --log error
bit use apps/my-nextjs-app --log error
- name: Show components, envs and status
run: |
cd my-nextjs-workspace
bit list --log error
bit envs --log error
bit status --log error
- name: Compile, lint, test components
run: |
cd my-nextjs-workspace
bit compile --log error
bit lint --log error
bit test --log error
- name: Run Next.js app component
run: |
cd my-nextjs-workspace
bit run my-nextjs-app --log error &
checkserver http://localhost:3000
- name: Tag components
run: |
cd my-nextjs-workspace
bit tag --message "initial tag" --log error
- name: Create a local scope
run: |
barescope my-org.my-scope my-nextjs-workspace
- name: Export components
run: |
cd my-nextjs-workspace
bit export --log error
continue-on-error: false

0 comments on commit 86d18a3

Please sign in to comment.