diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index e9514ceb..7c845576 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -10,58 +10,35 @@ jobs: deploy-preview: runs-on: ubuntu-latest permissions: - contents: read + contents: write pull-requests: write pages: write + id-token: write steps: - name: Checkout PR branch uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 1 - - - 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 }}/ + fetch-depth: 0 - name: Copy files to preview folder 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) + rsync -av --exclude='.git' --exclude='.github' --exclude='preview' ./ preview/pr-${{ github.event.pull_request.number }}/ + # Static site - copy all files except git directories and preview folder - 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_dir: ./preview 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; + destination_dir: pr-preview + keep_files: true + user_name: "github-actions[bot]" + user_email: "github-actions[bot]@users.noreply.github.com" + force_orphan: true - name: Comment PR with preview URL uses: marocchino/sticky-pull-request-comment@v2 @@ -69,4 +46,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} header: preview-url message: | - 🚀 PR Preview: ${{ steps.pages.outputs.result }}/pr-preview/pr-${{ github.event.pull_request.number }}/ + 🚀 **PR Preview Deployed!** + + 📱 **Preview URL:** https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.pull_request.number }}/ + + ✨ Your changes are now live! Click the link above to test your CodeClip enhancements. diff --git a/index.html b/index.html index 81bbeeda..5bea6c5f 100644 --- a/index.html +++ b/index.html @@ -1,352 +1,137 @@ - + - - - Challenges - CodeClip + CodeClip - Master Coding Challenges - - - - - + - - - - -
- -
-
-
-

- Coding Challenges -

-

- Test your skills with our curated collection of coding challenges. From beginner-friendly problems to advanced algorithms, there's something for every developer. -

-
-
-
- - -
-
-

Filter Challenges

-
-
-
- - -
-
- - -
-
- - - -
- -
- - -
- - - - -

Available Coding Challenges

-
-
-
-
- -
-
-

Two Sum

- Easy -
-

- Given an array of integers and a target sum, return indices of two numbers that add up to the target. -

-
- Arrays - Hash Table -
-
- - Solve Challenge - - + +
- - - - - - + - - - - \ No newline at end of file + + diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index a59b10b1..00000000 --- a/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "CodeClip", - "lockfileVersion": 3, - "requires": true, - "packages": {} -} diff --git a/pages/about.html b/pages/about.html index f4a1c3cf..e67bccb9 100644 --- a/pages/about.html +++ b/pages/about.html @@ -29,10 +29,10 @@