Skip to content

Commit

Permalink
setup deploy GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
fgandellini committed Jun 9, 2024
1 parent f4c4e98 commit b3706f7
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 302 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
push:
branches:
- 'main'

permissions:
contents: read
pages: write
id-token: write

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Read Node.js version from .nvmrc
id: nvmrc
uses: browniebroke/read-nvmrc-action@v1

- name: Set Node.js version
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvmrc.outputs.node_version }}'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm t
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
uses: bitovi/[email protected]
with:
path: apps/react/dist
7 changes: 2 additions & 5 deletions apps/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
"version": "1.0.0",
"scripts": {
"dev": "parcel src/index.html",
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" jest",
"build": "parcel build src/index.html",
"predeploy": "npm run build",
"deploy": "gh-pages -d apps/react/dist"
"test": "jest",
"build": "parcel build src/index.html"
},
"keywords": [
"2048",
Expand All @@ -26,7 +24,6 @@
"@types/jest": "^29.5.12",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"gh-pages": "^6.1.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"parcel": "^2.12.0",
Expand Down
Loading

0 comments on commit b3706f7

Please sign in to comment.