mirror of
https://github.com/andrewgioia/keyrune.git
synced 2025-12-15 16:20:44 +00:00
Reconfigures GH actions workflows for PR URL handling
This commit is contained in:
parent
4d95480324
commit
0d7c3e2f49
@ -7,22 +7,20 @@ on:
|
|||||||
- master
|
- master
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write # push to gh-pages
|
||||||
pages: write
|
pull-requests: write # create/update PR comment
|
||||||
id-token: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: docs-preview-${{ github.event.pull_request.number }}
|
group: docs-preview-${{ github.event.pull_request.number }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-and-deploy-preview:
|
||||||
name: Build docs
|
name: Build & deploy PR preview
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout PR branch
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
@ -34,41 +32,24 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Build docs (npm run publish)
|
- name: Build docs
|
||||||
run: npm run publish
|
run: npm run publish
|
||||||
|
|
||||||
- name: Upload artifact for GitHub Pages
|
- name: Deploy preview to gh-pages/pr-<number>/
|
||||||
uses: actions/upload-pages-artifact@v3
|
uses: peaceiris/actions-gh-pages@v4
|
||||||
with:
|
with:
|
||||||
path: ./docs
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_branch: gh-pages
|
||||||
deploy:
|
publish_dir: ./docs
|
||||||
name: Deploy PR preview
|
destination_dir: pr-${{ github.event.pull_request.number }}
|
||||||
needs: build
|
keep_files: true
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
page_url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Deploy to GitHub Pages (preview)
|
|
||||||
id: deployment
|
|
||||||
uses: actions/deploy-pages@v4
|
|
||||||
with:
|
|
||||||
# mark this as a preview deployment for a PR
|
|
||||||
preview: true
|
|
||||||
|
|
||||||
comment:
|
comment:
|
||||||
name: Comment preview URL on PR
|
name: Comment preview URL on PR
|
||||||
needs: deploy
|
needs: build-and-deploy-preview
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# only run if we actually got a URL, and only for same-repo PRs (forks have restricted tokens)
|
# only for same-repo PRs (no forks)
|
||||||
if: >
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||||
needs.deploy.outputs.page_url != '' &&
|
|
||||||
github.event.pull_request.head.repo.full_name == github.repository
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Find existing docs preview comment
|
- name: Find existing docs preview comment
|
||||||
@ -87,7 +68,7 @@ jobs:
|
|||||||
body: |
|
body: |
|
||||||
🔍 **Keyrune docs preview**
|
🔍 **Keyrune docs preview**
|
||||||
|
|
||||||
Preview URL: ${{ needs.deploy.outputs.page_url }}
|
Preview URL: https://keyrune.andrewgioia.com/pr-${{ github.event.pull_request.number }}/
|
||||||
|
|
||||||
- Source branch: `${{ github.head_ref }}`
|
- Source branch: `${{ github.head_ref }}`
|
||||||
- Target branch: `${{ github.base_ref }}`
|
- Target branch: `${{ github.base_ref }}`
|
||||||
@ -45,7 +45,7 @@
|
|||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<section>
|
<section>
|
||||||
<h3>
|
<h3>
|
||||||
View the full list of set and expansion symbols below, for all sets and special edition products up to <strong>Avatar: the Last Airbender</strong>. To use the symbols on your desktop or just get the vectors, check out the <a href="cheatsheet.html">Cheatsheet</a>.
|
View the full list of set and expansion symbols below, for all sets and special edition products up to <strong>Lorwyn Eclipsed and TMNT</strong>. To use the symbols on your desktop or just get the vectors, check out the <a href="cheatsheet.html">Cheatsheet</a>.
|
||||||
</h3>
|
</h3>
|
||||||
<p style="margin: -15px 0 25px;">
|
<p style="margin: -15px 0 25px;">
|
||||||
<strong>Note:</strong> you can now link directly to a preview of each symbol's by adding the symbol code at the end of the url like this: <a href="https://keyrune.andrewgioia.com/icons.html?icon=ody">https://keyrune.andrewgioia.com/icons.html?icon=ody</a>.
|
<strong>Note:</strong> you can now link directly to a preview of each symbol's by adding the symbol code at the end of the url like this: <a href="https://keyrune.andrewgioia.com/icons.html?icon=ody">https://keyrune.andrewgioia.com/icons.html?icon=ody</a>.
|
||||||
|
|||||||
@ -43,7 +43,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Current version 3.17.1 includes all sets to Avatar: The Last Airbender.
|
Current version 3.18.0 includes all sets to Lorwyn Eclipsed.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user