diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml new file mode 100644 index 0000000..b683c1a --- /dev/null +++ b/.github/workflows/CD.yml @@ -0,0 +1,58 @@ +name: Deploy Support-Us-Button to GitHub Pages + +on: + push: + branches: + - main + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run vite:build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + needs: build + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/package.json b/package.json index e0babb6..0e21f59 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,9 @@ "build:js": "rollup -c", "build": "npm run build:css && npm run build:js", "dev": "rollup -c -w", - "dev:demo": "vite", + "vite:dev": "vite", + "vite:build": "vite build", + "vite:preview": "vite preview", "type-check": "tsc --noEmit", "test": "npm run type-check && vitest run --passWithNoTests", "prepublishOnly": "npm run build"