Skip to content

Commit 2c6ba90

Browse files
authored
Create main.yml
1 parent 1f23d3a commit 2c6ba90

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/main.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
name: Build
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
20+
- name: Install Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: '16.6.1'
24+
cache: npm
25+
26+
- name: Install NPM packages
27+
run: npm ci
28+
29+
- name: Build project
30+
run: CI=false npm run build
31+
32+
- name: Upload production-ready build files
33+
uses: actions/upload-artifact@v2
34+
with:
35+
name: production-files
36+
path: ./build
37+
38+
deploy:
39+
name: Deploy
40+
needs: build
41+
runs-on: ubuntu-latest
42+
if: github.ref == 'refs/heads/main'
43+
44+
steps:
45+
- name: Download artifact
46+
uses: actions/download-artifact@v2
47+
with:
48+
name: production-files
49+
path: ./build
50+
51+
- name: Deploy to gh-pages
52+
uses: peaceiris/actions-gh-pages@v3
53+
with:
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
publish_dir: ./build
56+
cname: open-domains.net

0 commit comments

Comments
 (0)