Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Merge branch 'main' into PDX-812
Browse files Browse the repository at this point in the history
  • Loading branch information
brianluisgomez authored Nov 1, 2023
2 parents 1580570 + c4602b5 commit ba90277
Show file tree
Hide file tree
Showing 73 changed files with 3,986 additions and 3,445 deletions.
3 changes: 2 additions & 1 deletion .github/actions/replace_specs_snippets/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ outputs:
runs:
using: "composite"
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ inputs.token }}

Expand Down
5 changes: 4 additions & 1 deletion .github/actions/rollback_release/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ async function rollbackRelease() {
const goodRelease = cleanedData[1].name

core.setOutput("goodRelease", goodRelease)

workflows = await octokit.request('GET /repos/Bandwidth/api-docs/actions/workflows')
publishId = workflows.data.workflows.find(x => x.name === 'Publish Docsite').id

await octokit.request(`PATCH /repos/Bandwidth/api-docs/releases/${badReleaseId}`, {
tag_name: badRelease,
draft: true,
})

await octokit.request('POST /repos/Bandwidth/api-docs/actions/workflows/3796239/dispatches', {
await octokit.request(`POST /repos/Bandwidth/api-docs/actions/workflows/${publishId}/dispatches`, {
ref: goodRelease,
})
}
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/blog-posts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ jobs:

- name: Commit Changes and Create Pull Request
run: |
git add site/blogposts.config.json
git commit -m 'update blog posts'
git push origin sync-blog-posts
gh pr create -B main -H sync-blog-posts --title 'Update Blog Posts' --body 'Auto-generated by Blog Posts Listener Workflow'
if git diff-index --quiet HEAD
then
echo 'nothing to commit, working tree clean'
else
git add site/blogposts.config.json
git commit -m 'update blog posts'
git push origin sync-blog-posts
gh pr create -B main -H sync-blog-posts --title 'SWI-3460 Update Blog Posts' --body 'Auto-generated by Blog Posts Listener Workflow'
fi
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
12 changes: 8 additions & 4 deletions .github/workflows/cypress-prod-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ on:
jobs:
cypress_nightly:
name: Cypress Nightly Tests
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
container:
image: cypress/browsers:node16.13.2-chrome97-ff96
image: cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
options: --user 1001 --shm-size=2g
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [16, 18, 20.5.1]
browser: [chrome]
exclude:
- node-version: 16
browser: firefox
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- name: Checkout
uses: actions/checkout@v3
Expand All @@ -34,6 +37,7 @@ jobs:
config-file: prod-cypress.config.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

notify_for_failures:
name: Notify for Failures
needs: [cypress_nightly]
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/listener.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
if: ${{ github.event.action == 'Open' || github.event.action == 'Update' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Pass branch name to env
run: |
Expand All @@ -31,7 +32,7 @@ jobs:
- name: Open Pull Request
if: steps.replace-specs-snippets.outputs.needs_pr
run: |
hub pull-request --base Bandwidth:main $(if ${{ github.event.client_payload.draftPr }} ; then echo "-d" ; fi) -m '${{ github.event.client_payload.branchName }}' -m 'Update API specs from upstream api-specs repository. Opened By: @${{ github.event.client_payload.author }}'
gh pr create -B main $(if ${{ github.event.client_payload.draftPr }} ; then echo "-d" ; fi) -t '${{ github.event.client_payload.branchName }}' -b 'Update API specs from upstream api-specs repository. Opened By: @${{ github.event.client_payload.author }}'
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

Expand Down Expand Up @@ -59,7 +60,8 @@ jobs:
if: ${{ github.event.action == 'Merge' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branchName }}

Expand Down Expand Up @@ -106,9 +108,10 @@ jobs:
if: ${{ github.event.action == 'Close' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

# Close the cooresponding PR
# Close the corresponding PR
# - run: |
# PR_NUMBER=$(hub pr list -h ${{ github.event.client_payload.branchName }} -f %I)
# hub issue update $PR_NUMBER -s closed
Expand Down Expand Up @@ -136,7 +139,8 @@ jobs:
if: ${{ github.event.action == 'Draft' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Check and Update Draft Status
run: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/lts-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Create LTS Versions

on:
schedule:
- cron: '0 0 1,16 * *'
- cron: "0 0 1,16 * *"
workflow_dispatch:

jobs:
Expand All @@ -22,7 +22,7 @@ jobs:
if [ $REL_TIME '>' $LTS_TIME ]; then curl -s -X PATCH -H "Accept: application/vnd.github+json" -H "Authorization: token $TOKEN" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/$REL_ID -d '{"name":"'"${REL_NAME}-LTS"'"}' > /dev/null; echo "new_lts_zip=$REL_ZIP" >> $GITHUB_OUTPUT; echo "release_name=$REL_NAME" >> $GITHUB_OUTPUT; else echo "no_release=true" >> $GITHUB_OUTPUT; fi # If there has been a non-LTS release since the last LTS release, create a new LTS release
env:
TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

create_lts:
name: Create A New LTS Release
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,8 +54,8 @@ jobs:
uses: Bandwidth/[email protected]
with:
bucket-name: ${{ steps.bucket_name.outputs.bucket_name }}
bucket-expiration: '180'
bucket-region: 'us-east-1'
bucket-expiration: "180"
bucket-region: "us-east-1"
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
content-path: ./lts/build
Expand All @@ -68,7 +68,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure Git and Create Branch
run: |
git config user.email "[email protected]"
Expand All @@ -86,6 +86,6 @@ jobs:
git add site/lts.config.json
git commit -m 'update lts table'
git push origin auto-update-lts
gh pr create -B main -H auto-update-lts --title 'Update LTS Versions Table' --body 'Auto-generated by Create LTS Versions Workflow'
gh pr create -B main -H auto-update-lts --title 'SWI-3486 Update LTS Versions Table' --body 'Auto-generated by Create LTS Versions Workflow'
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
70 changes: 1 addition & 69 deletions .github/workflows/pr-closed-delete-staging-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,8 @@ on:
- "site/**"

jobs:
cypress_cloudfront:
name: Cypress Against Cloudfront Staged Site
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
browser: [chrome]
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Checkout
uses: actions/checkout@v3

- 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: Set Environment Variables
run: |
BRANCH_NAME=${GITHUB_HEAD_REF#refs/heads/}
BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]')
BRANCH_NAME=$(echo "$BRANCH_NAME" | sed -e "s/[^a-z0-9]/-/g")
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- name: Create Cypress Config
run: |
cd ./site
cat >staged-cypress.config.js <<EOL
const { defineConfig } = require("cypress");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
baseUrl: "https://${{env.BRANCH_NAME}}.staging-dev.bandwidth.com/"
},
projectId: "oz7rpf",
pageLoadTimeout: 60000,
viewportWidth: 1440,
viewportHeight: 900,
video: false,
videoUploadOnPasses: false,
screenshotOnRunFailure: true,
retries: 3,
});
EOL
- name: Cypress Staged Cloudfront Deployment Test
uses: cypress-io/[email protected]
timeout-minutes: 40
with:
browser: ${{ matrix.browser }}
working-directory: ./site
config-file: staged-cypress.config.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

delete_bucket_folder:
name: Delete Bucket Folder
if: ${{ success() || github.event.pull_request.merged == false }}
needs: [cypress_cloudfront]
runs-on: ubuntu-latest
steps:
- name: Set Environment Variables
Expand All @@ -102,7 +34,7 @@ jobs:

notify_for_failures:
name: Notify for Failures
needs: [cypress_cloudfront, delete_bucket_folder]
needs: [delete_bucket_folder]
if: failure()
runs-on: ubuntu-latest
steps:
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/pr-publish-docsite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,23 @@ jobs:
cypress:
name: Cypress Tests
if: github.event.pull_request.draft == false
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
container:
image: cypress/browsers:node16.13.2-chrome97-ff96
image: cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
options: --user 1001 --shm-size=2g
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [16, 18, 20.5.1]
browser: [chrome]
exclude:
- node-version: 16
browser: firefox
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: ${{ matrix.node-version }}

- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -61,7 +64,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- name: Set Environment Variables
run: |
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/publish-docsite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ on:
jobs:
cypress:
name: Cypress Tests
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
container:
image: cypress/browsers:node16.13.2-chrome97-ff96
image: cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
options: --user 1001 --shm-size=2g
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [16, 18, 20.5.1]
browser: [chrome]
exclude:
- node-version: 16
browser: firefox
steps:
- name: Setup Node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -56,7 +59,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- name: Generate Static Site
run: |
Expand Down Expand Up @@ -109,18 +112,21 @@ jobs:
cypress_post_tests:
name: Cypress run on prod
needs: [cypress, publish]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
container:
image: cypress/browsers:node16.13.2-chrome97-ff96
image: cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
options: --user 1001 --shm-size=2g
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [16, 18, 20.5.1]
browser: [chrome]
exclude:
- node-version: 16
browser: firefox
steps:
- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand Down Expand Up @@ -158,12 +164,13 @@ jobs:
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- name: Install Dependencies
run: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/rollback-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ jobs:
name: Rollback Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- name: Install Dependencies
run: |
Expand Down
Loading

0 comments on commit ba90277

Please sign in to comment.