Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/listener.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
issue_number: ${{ github.event.client_payload.prNumber }},
owner: 'Bandwidth',
repo: '${{ github.event.client_payload.originRepo }}',
body: 'Preview site: http://{{ env.BRANCH_NAME }}.staging-dev.bandwidth.com/\nPlease note that it may take a couple minutes for your preview site to become available.\n\nSee the corresponding PR opened on the docsite repository (no action required):\nhttps://github.com/Bandwidth/api-docs/pull/${{ env.PR_NUMBER }}'
body: 'Preview site: http://bw-api-docs-${{ env.BRANCH_NAME }}.s3-website-us-east-1.amazonaws.com/\nPlease note that it may take a couple minutes for your preview site to become available.\n\nSee the corresponding PR opened on the docsite repository (no action required):\nhttps://github.com/Bandwidth/api-docs/pull/${{ env.PR_NUMBER }}'
})

merge:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/pr-closed-delete-bucket.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Deletes the staging docsite bucket on PR closed

name: PR Closed Delete Bucket

on:
pull_request:
types: [closed]
branches:
- 'main'
paths:
- 'site/**'

jobs:
delete_bucket:
name: Delete Bucket
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Create Bucket Name
id: create_name
run: |
BUCKET_NAME=bw-api-docs-${GITHUB_HEAD_REF#refs/heads/}
BUCKET_NAME=$(echo "$BUCKET_NAME" | tr '[:upper:]' '[:lower:]') #convert to lowercase for AWS bucket (can't be uppercase)
BUCKET_NAME=$(echo "$BUCKET_NAME" | sed -e "s/[^a-z0-9]/-/g") #replace all remaining non alphanumerics with -
echo $BUCKET_NAME
echo "::set-output name=bucket_name::$BUCKET_NAME"
- name: Delete Bucket
run: |
aws s3 rb s3://$BUCKET_NAME --force --region us-east-1
env:
BUCKET_NAME: ${{ steps.create_name.outputs.bucket_name }}
120 changes: 0 additions & 120 deletions .github/workflows/pr-closed-delete-staging-site.yml

This file was deleted.

Loading