Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preview close directory #54

Merged
merged 7 commits into from
Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/pr-close.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ jobs:

pr-close:
runs-on: ubuntu-latest

permissions:
issues: write
pull-requests: write
contents: write

steps:

Expand All @@ -27,6 +32,16 @@ jobs:
- name: Push Preview Env Changes
uses: ad-m/github-push-action@master
with:
directory: previews
github_token: ${{ secrets.GH_ORG_TOKEN }}
repository: cloudnativeentrepreneur/example-preview-envs
repository: cloudnativeentrepreneur/example-preview-envs

- name: Create comment about garbage collection
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Your preview environment has been removed. It will be garbage collected soon.

To create a new preview environment, open a new pull request.
edit-mode: replace
25 changes: 25 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
permissions:
packages: write
contents: write
issues: write
pull-requests: write

steps:

Expand Down Expand Up @@ -112,4 +114,27 @@ jobs:
github_token: ${{ secrets.GH_ORG_TOKEN }}
repository: cloudnativeentrepreneur/example-preview-envs

- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Your preview environment

- name: Create or update comment
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Your preview environment has been published! :rocket:

It may take a few minutes to spin up, but you can view it here once it's ready: [${{ github.event.repository.name }}-pr-${{ github.event.pull_request.number }}-preview](http://${{ github.event.repository.name }}.example-ui-pr-${{ github.event.pull_request.number }}-preview.127.0.0.1.sslip.io)

You can verify the PR is ready with `kubectl`:

```bash
kubectl get ksvc -n example-ui-pr-${{ github.event.pull_request.number }}-preview
```
edit-mode: replace
2 changes: 1 addition & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ image:
env:

service:
name: sveltekit-web3auth
name: sveltekit-web3auth-template
internalPort: 3000

knative:
Expand Down