diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d482e00 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + # Workflow files stored in the + # default location of `.github/workflows` + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "chore" + include: "scope" + labels: + - "dependencies" diff --git a/.github/workflows/site-preview.yml b/.github/workflows/site-preview.yml new file mode 100644 index 0000000..f68b396 --- /dev/null +++ b/.github/workflows/site-preview.yml @@ -0,0 +1,60 @@ +name: Site preview + +on: + pull_request: + branches: + - main + +jobs: + site-preview: + name: Publish site preview + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: "refs/pull/${{ github.event.number }}/merge" + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.1" + bundler-cache: true + + - name: Build Jekyll website + run: bundler exec jekyll build + + - name: Install Netlify CLI + run: npm install --location=global netlify-cli@17.x.x + + - name: Deploy Preview to Netlify + run: | + netlify deploy \ + --alias="${GITHUB_REPOSITORY#*/}-${{ github.event.number }}" \ + --auth=${{ secrets.NETLIFY_AUTH_TOKEN }} \ + --dir="_site" \ + --site=${{ vars.NETLIFY_PREVIEW_APP_SITE_ID }} + + - name: Find existing comment + uses: peter-evans/find-comment@v3 + id: find-comment + with: + issue-number: ${{ github.event.number }} + comment-author: "github-actions[bot]" + body-includes: "Preview url: https://" + + - name: Add Netlify link PR comment + uses: actions/github-script@v7 + if: steps.find-comment.outputs.comment-id == '' + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const hostnameSuffix = "compiler-previews.netlify.app" + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `Preview url: https://${context.repo.repo}-${{ github.event.number }}--${hostnameSuffix}`, + }) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57510a2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +_site/