Skip to content

Commit 2a14b02

Browse files
authored
Create deploy.yml
`npm ci; npm run build` and deploy `./dist` to GitHub Pages https://vogler.github.io/2248-web
1 parent 54b0fbf commit 2a14b02

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/deploy.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: npm build and deploy to GitHub Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
20+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
21+
concurrency:
22+
group: "pages"
23+
cancel-in-progress: false
24+
25+
jobs:
26+
# Single deploy job since we're just deploying
27+
deploy:
28+
environment:
29+
name: github-pages
30+
url: ${{ steps.deployment.outputs.page_url }}
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v3
35+
- name: Setup Node
36+
uses: actions/setup-node@v3
37+
with:
38+
node-version: "18"
39+
cache: 'npm'
40+
- run: npm ci
41+
- run: npm run build --if-present
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v3
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v1
46+
with:
47+
path: ./dist
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)