Skip to content

Commit

Permalink
Fix package lock and update CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
timendum committed Aug 20, 2024
1 parent baa57e5 commit 6f0b40b
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 37 deletions.
19 changes: 4 additions & 15 deletions .codesandbox/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@

// These tasks can be run from CodeSandbox. Running one will open a log in the app.
"tasks": {
"start": {
"name": "start",
"command": "npm run start",
"runAtStart": true
},
"dev": {
"name": "dev",
"command": "npm run dev",
Expand All @@ -24,19 +19,13 @@
"command": "npm run build",
"runAtStart": false
},
"test": {
"name": "test",
"command": "npm run test",
"runAtStart": false
},
"eject": {
"name": "eject",
"command": "npm run eject",
"runAtStart": false
},
"prettier write": {
"name": "prettier write",
"command": "npx prettier -w app"
},
"lint": {
"name": "lint",
"command": "npm run lint"
}
}
}
60 changes: 38 additions & 22 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,69 @@
name: Deploy static content to Pages and Create release on tag
name: Build and deploy to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
group: 'pages'
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uploadrelease:
runs-on: ubuntu-latest
needs: deploy
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Create archives
run: |
npm run build
tar -cvzf release.tar.gz --exclude='*.map' -C build .
tar -cvzf release-with-maps.tar.gz -C build .
- name: GH Release
Expand All @@ -46,14 +72,4 @@ jobs:
with:
files: |
release.tar.gz
release-with-maps.tar.gz
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist folder
path: "./build"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
release-with-maps.tar.gz
61 changes: 61 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6f0b40b

Please sign in to comment.