diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..7c3bcff --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,25 @@ +name: Deploy + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: install + run: npm ci + + - name: build + run: npm run build + + - name: deploy pages + uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + branch: gh-pages + folder: dist diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 1d05655..0000000 --- a/deploy.sh +++ /dev/null @@ -1,12 +0,0 @@ -git checkout main -# create a local temp branch containing the splitted output folder -git subtree split --prefix dist -b temp - -git checkout temp -git add . -git commit -m "deploying" - -# force the push of the gh-pages branch to the remote gh-pages branch at origin -git push -f origin HEAD:gh-pages -# delete the local temp because you will need it: ref -git branch -D temp \ No newline at end of file diff --git a/package.json b/package.json index b837f70..3037d83 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,7 @@ "lint": "npx eslint src test", "lint:fix": "npm run lint -- --fix", "prettier": "npx prettier src test --check", - "prettier:fix": "npm run prettier -- --write", - "deploy": "npm run build && chmod +x ./deploy.sh && ./deploy.sh" + "prettier:fix": "npm run prettier -- --write" }, "imports": { "#*": [