Skip to content

Draft

Draft #3

Workflow file for this run

name: Build PR Preview
on:
pull_request:
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- '*.md'
- '*.txt'
- '.all-contributorsrc'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate Roq Site
uses: quarkiverse/quarkus-roq@v1
with:
site-draft: 'true'
site-future: 'true'
github-pages: 'false'
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
runs-on: ubuntu-latest
needs: build
steps:
- name: Store PR id as variable
id: pr
run: |
echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
rm -f pr-id.txt
- name: Publishing blog to Surge.sh
id: deploy-blog
run: npx surge ./ --domain https://onepoint-tech-${{ steps.pr.outputs.id }}-preview.surge.sh --token ${{ secrets.SURGE_TOKEN }}
- name: Update PR status comment on success
uses: quarkusio/action-helpers@main
with:
action: maintain-one-comment
github-token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ steps.pr.outputs.id }}
body: |
🚀 PR Preview for **blog** ${{ github.sha }} has been successfully built!
* https://onepoint-tech-${{ steps.pr.outputs.id }}-preview.surge.sh
body-marker: <!-- Preview status comment marker -->
- name: Update PR status comment on failure
uses: quarkusio/action-helpers@main
if: ${{ failure() }}
with:
action: maintain-one-comment
github-token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ steps.pr.outputs.id }}
body: |
😭 Deploy PR Preview failed.
body-marker: <!-- Preview status comment marker -->