diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 5401b7f8..933c0c01 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -30,6 +30,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: 20 + - name: Install Node deps + run: npm ci + - name: Compile typescript + run: npm run build - name: Setup Ruby uses: ruby/setup-ruby@v1 with: @@ -38,12 +46,12 @@ jobs: cache-version: 0 # Increment this number if you need to re-download cached gems - name: Setup Pages id: pages - uses: actions/configure-pages@v2 + uses: actions/configure-pages@v5 - run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" # defaults output to '/_site' env: JEKYLL_ENV: production - name: Upload artifact - uses: actions/upload-pages-artifact@v1 # This will automatically upload an artifact from the '/_site' directory + uses: actions/upload-pages-artifact@v3 # This will automatically upload an artifact from the '/_site' directory - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/preview-pr.yaml b/.github/workflows/preview-pr.yaml new file mode 100644 index 00000000..f171f712 --- /dev/null +++ b/.github/workflows/preview-pr.yaml @@ -0,0 +1,47 @@ +name: preview-pr + +on: + pull_request_target: + types: [opened, reopened, synchronize] + +permissions: + pull-requests: write + +jobs: + authorize: + environment: + ${{ github.event_name == 'pull_request_target' && + github.event.pull_request.head.repo.full_name != github.repository && + 'external' || 'internal' }} + runs-on: ubuntu-latest + steps: + - run: "true" + + build: + needs: authorize + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + bundler-cache: true + - run: bundle exec jekyll build --baseurl "" + - name: Publish to Cloudflare Pages + id: preview-pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT }} + projectName: hack-gpon-preview + directory: _site + branch: preview + - uses: thollander/actions-comment-pull-request@v2 + with: + message: | + Preview of the website obtained from the PR: ${{ steps.preview-pages.outputs.url }} + diff --git a/.gitignore b/.gitignore index 7c68ae88..02a683b3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ _site/ .jekyll-cache/ .jekyll-metadata Gemfile.lock -assets/js/zzzz-search-data.json \ No newline at end of file +assets/js/zzzz-search-data.json +node_modules/ +assets/js/generated diff --git a/404.md b/404.md index e8be9b6b..dba17acb 100644 --- a/404.md +++ b/404.md @@ -8,7 +8,7 @@ description: Opps. The page you are looking for got lost. --- -
Those are not the ONT you are looking for. Try using the navigation {% if site.search_enabled != false %}or search {% endif %}to find what you're looking for or go to this site's home page.
+This is not the ONT you are looking for. Try using the navigation bar {% if site.search_enabled != false %}or search {% endif %}to find what you're looking for or go to the website's home page.