Skip to content

Commit

Permalink
ci: cherry-pick of version-4-0 (#1717)
Browse files Browse the repository at this point in the history
Co-authored-by: Karl Cardenas <karl@spectrocloud.com>
  • Loading branch information
caroldelwing and karl-cardenas-coding committed Oct 27, 2023
1 parent de466c6 commit 2742efb
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"repoName": "librarium",
"editor": "code",

"targetBranchChoices": ["master", "version-4-0", "version-3-4"],
"targetBranchChoices": ["master", "version-4-1", "version-4-0", "version-3-4"],

"autoMerge": true,
"autoMergeMethod": "squash",
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:

jobs:
run-ci:
# runs-on: ubuntu-latest
runs-on: ubuntu-latest
defaults:
run:
Expand Down
51 changes: 46 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ name: Release to Production
# or a version branch (e.g. version-4-0)

on:
push:
branches: ['master', 'version-**']
schedule:
- cron: '0 20 * * 1-5' # At 12:00 PM PST (8 PM UTC), Monday through Friday
- cron: '0 5 * * 2-6' # At 9:00 PM PST (5 AM UTC next day), Monday through Friday
workflow_dispatch:

inputs:
useGitHubHostedLargeRunner:
description: 'Use the GitHub-hosted large runner. Allowed values are true or false. Caution - this results in additional charges to the organization.'
required: false
default: false

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -27,7 +32,8 @@ concurrency:
cancel-in-progress: true

jobs:
build:
# This is the default workflow that uses the self-hosted runner. The self-hosted runner is slower than the GitHub-hosted large runner, but it does not incurr additional charges.
build-self-hosted-runner:
name: Build Website
runs-on:
group: 'Doc Runners'
Expand Down Expand Up @@ -59,9 +65,44 @@ jobs:
aws s3 sync --cache-control 'public, max-age=0, s-maxage=604800' build/ s3://docs.spectrocloud.com --delete
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/*"
# Use this workflow if you want to use the GitHub-hosted large runner. Useful for scenarios when you need a change to deploy faster than the self-hosted runner can build it.
build-large-runner:
name: Build Website
runs-on:
group: 'Doc Runners'
labels: docbot
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "master"


- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"

- run: npm ci

- name: Compile
run: |
make versions-ci
make build
- name: Upload to AWS
run: |
aws s3 sync --cache-control 'public, max-age=604800' --exclude '*.html' --exclude '*.xml' --exclude build/scripts/ build/ s3://docs.spectrocloud.com --delete
aws s3 sync --cache-control 'public, max-age=0, s-maxage=604800' build/ s3://docs.spectrocloud.com --delete
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/*"
release:
name: "Release"
needs: [build]
if: always() && (needs.build-large-runner.result == 'success' || needs.build-self-hosted-runner.result == 'success')
needs: [build-self-hosted-runner,build-large-runner]
runs-on: ubuntu-latest
steps:
- id: checkout
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/version-branch-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
pull_request:
branches:
- 'version-[0-9]-[0-9]'
types: [opened, synchronize, reopened]
workflow_dispatch:



Expand Down
3 changes: 3 additions & 0 deletions archiveVersions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"v3.4.x and prior": "https://version-3-4.legacy.docs.spectrocloud.com"
}

0 comments on commit 2742efb

Please sign in to comment.