diff --git a/.github/workflows/sharevb-github-pages-publish.yml b/.github/workflows/sharevb-github-pages-publish.yml new file mode 100644 index 00000000..bae00e2d --- /dev/null +++ b/.github/workflows/sharevb-github-pages-publish.yml @@ -0,0 +1,60 @@ +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["chore/all-my-stuffs"] + + # 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 +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 8 + run_install: true + + - name: Build + run: | + BASE_URL="/it-tools/" pnpm build + cp dist/index.html dist/404.html + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './dist' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/README.md b/README.md index 9c50bd6c..c3f102fe 100644 --- a/README.md +++ b/README.md @@ -95,72 +95,7 @@ Then navigate to http://localhost:8080/it-tools/ ## To build for GitHub Pages: 1. Enable GitHub Pages build and deployment option in your fork, under **Settings** > **Pages** and select **GitHub Actions** as the source -2. Add the following GitHub action to your repo: - -.github/workflows/deploy-pages.yaml -```yaml -name: Deploy static content to Pages - -on: - # Runs on pushes targeting the default branch - push: - 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 -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 - - - uses: pnpm/action-setup@v2 - name: Install pnpm - id: pnpm-install - with: - version: 8 - run_install: true - - - name: Build - run: | - BASE_URL="/it-tools/" pnpm build - cp dist/index.html dist/404.html - - - name: Setup Pages - uses: actions/configure-pages@v3 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: './dist' - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 -``` +2. Add the following GitHub action to your repo: https://github.com/sharevb/it-tools/.github/workflows/sharevb-github-pages-publish.yml ## Installation methods