This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
Update Event “appuio-beerup-8/index” #370
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
pull_request: | |
types: | |
- closed | |
env: | |
ENVIRONMENT: test | |
OPENSHIFT_API: https://api.cloudscale-lpg-2.appuio.cloud:6443 | |
HELM_RELEASE_NAME: website-pr-${{ github.event.number }} | |
IMG_NAME: nginx | |
IMG_TAG: pr-${{ github.event.number }} | |
NAMESPACE: appuio-website-test | |
jobs: | |
uninstall: | |
runs-on: ubuntu-latest | |
if: ${{ !startsWith(github.head_ref, 'renovate/') }} | |
environment: preview | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Authenticate and set context | |
uses: redhat-actions/oc-login@v1 | |
with: | |
openshift_server_url: ${{ env.OPENSHIFT_API }} | |
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | |
namespace: ${{ env.NAMESPACE }} | |
- name: Uninstall app | |
run: helm -n ${{ env.NAMESPACE }} uninstall ${{ env.HELM_RELEASE_NAME }} --wait | |
- name: Delete image in registry | |
run: oc -n ${{ env.NAMESPACE }} delete imagestreamtags ${{ env.IMG_NAME }}:${{ env.IMG_TAG }} --ignore-not-found | |
- name: Notify on failure | |
uses: peter-evans/create-or-update-comment@v2 | |
if: ${{ failure() }} | |
with: | |
issue-number: ${{ github.event.number }} | |
body: | | |
## ❌ Failed to remove preview deployment | |
| | | | |
|-|-| | |
**Helm release** | ${{ env.NAMESPACE }}/${{ env.HELM_RELEASE_NAME }} | |
**Cluster** | ${{ env.OPENSHIFT_API }} | |
Please investigate what went wrong in the GitHub actions logs. | |
Maintainers can manually remove the deployment by running | |
```bash | |
helm -n ${{ env.NAMESPACE }} uninstall ${{ env.HELM_RELEASE_NAME }} --wait | |
oc -n ${{ env.NAMESPACE }} delete imagestreamtags ${{ env.IMG_NAME }}:${{ env.IMG_TAG }} --ignore-not-found | |
``` |