Skip to content

Commit d1df661

Browse files
authored
Create main.yml
Create CI CD workflow
1 parent eb6a979 commit d1df661

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/main.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Deploy Next.js site to Pages
2+
3+
on:
4+
# Runs on pushes targeting the working branch
5+
push:
6+
branches:
7+
- working
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Install Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 18
35+
36+
- name: Run install
37+
uses: borales/actions-yarn@v4
38+
with:
39+
cmd: install # will run `yarn install` command
40+
41+
- name: Build production bundle
42+
uses: borales/actions-yarn@v4
43+
with:
44+
cmd: build # will run `yarn build` command
45+
46+
- name: Setup Pages
47+
id: setup_pages
48+
uses: actions/configure-pages@v5
49+
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: ./out
54+
55+
deploy:
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
runs-on: ubuntu-latest
60+
needs: build
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)