Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkiverse#51 from mcruzdev/issue-49
Browse files Browse the repository at this point in the history
Add preview-teardown
mcruzdev authored Aug 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 847cf8f + a44accd commit 770ee94
Showing 2 changed files with 27 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/preview-teardown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Surge.sh Preview Teardown

on:
pull_request_target:
paths:
- "*.adoc"
types: [closed]

jobs:
preview-teardown:
runs-on: ubuntu-latest
steps:
- name: Teardown surge preview
id: deploy
run: npx surge teardown https://quarkus-roq-preview-pr-${{ github.event.number }}.surge.sh --token ${{ secrets.SURGE_TOKEN }}
- name: Update PR status comment
uses: actions-cool/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
🙈 The PR is closed and the preview is expired.
<!-- Sticky Pull Request Comment -->
body-include: "<!-- Sticky Pull Request Comment -->"
number: ${{ github.event.number }}
6 changes: 3 additions & 3 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -9,13 +9,13 @@ on:
jobs:
preview:
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
if: github.event.workflow_run.event == 'pull_request'
steps:
- name: Download PR Artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
workflow_conclusion: ""
name: site
- name: Store PR id as variable
id: pr
@@ -30,7 +30,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
🎊 PR Preview ${{ github.sha }} has been successfully built and deployed. See the documentation preview: https://quarkus-roqpreview-pr-${{ steps.pr.outputs.id }}.surge.sh
🎊 PR Preview ${{ github.sha }} has been successfully built and deployed. See the documentation preview: https://quarkus-roq-preview-pr-${{ steps.pr.outputs.id }}.surge.sh
<!-- Sticky Pull Request Comment -->
body-include: "<!-- Sticky Pull Request Comment -->"
number: ${{ steps.pr.outputs.id }}

0 comments on commit 770ee94

Please sign in to comment.