diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index e9514ceb..dd0658a9 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -1,72 +1,21 @@ -name: PR Preview to GitHub Pages +name: Deploy Preview on: pull_request: types: [opened, synchronize, reopened] - branches: - - main jobs: - deploy-preview: + deploy: runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - pages: write steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 1 + - name: Checkout Code + uses: actions/checkout@v3 - - name: Set up Node.js - if: env.BUILD_REQUIRED == 'true' # Set this environment variable in the repository settings if a build is needed - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' # Cache dependencies for faster builds - - - name: Install dependencies - if: env.BUILD_REQUIRED == 'true' - run: npm ci # Use npm ci for reproducible builds - - - name: Build project - if: env.BUILD_REQUIRED == 'true' - run: npm run build # Replace with your build command (e.g., `hugo`, `vite build`, etc.) - env: - BASE_URL: /${{ github.repository }}/pr-preview/pr-${{ github.event.pull_request.number }}/ - - - name: Copy files to preview folder + - name: Set up preview path run: | mkdir -p preview/pr-${{ github.event.pull_request.number }} - cp -r ./dist/* preview/pr-${{ github.event.pull_request.number }}/ || cp -r ./* preview/pr-${{ github.event.pull_request.number }}/ - # Copies from `dist` if a build step exists, otherwise copies all files (excluding .git, .github) - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./preview/pr-${{ github.event.pull_request.number }} - publish_branch: gh-pages - destination_dir: pr-preview/pr-${{ github.event.pull_request.number }} - keep_files: false # Clean up old files to avoid bloat - user_name: 'github-actions[bot]' - user_email: 'github-actions[bot]@users.noreply.github.com' - - - name: Get GitHub Pages URL - id: pages - uses: actions/github-script@v7 - with: - script: | - const response = await github.rest.repos.getPages({ owner: context.repo.owner, repo: context.repo.repo }); - return response.data.html_url; - - - name: Comment PR with preview URL - uses: marocchino/sticky-pull-request-comment@v2 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - header: preview-url - message: | - 🚀 PR Preview: ${{ steps.pages.outputs.result }}/pr-preview/pr-${{ github.event.pull_request.number }}/ + - name: Copy static files to preview folder + run: | + rsync -av --exclude='preview' . preview/pr-${{ github.event.pull_request.number }}/ diff --git a/about/index.html b/about/index.html new file mode 100644 index 00000000..937c71aa --- /dev/null +++ b/about/index.html @@ -0,0 +1,107 @@ + + +
+ + +🧠 Learn About CodeClip
++ CodeClip is a browser-first, zero-backend snippet manager that helps developers organize and reuse code effortlessly — right inside your browser. +
+
+ CodeClip is a fast, clean code snippet manager made for developers who want zero clutter and 100% local privacy. Your code stays in your browser via localStorage — no databases, no accounts, no distractions.
+
+ CodeClip is built with love for the open-source community. Contribute, fork, or star the project on GitHub: +
+ + 🌐 View on GitHub + +