ci: updated backport PR netlify logic (#1594) (#1596) #315
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: Release to Production | |
# Run this workflow every time a new commit is pushed to the master branch | |
# or a version branch (e.g. version-4-0) | |
on: | |
push: | |
branches: ['master', 'version-**'] | |
workflow_dispatch: | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_KEY }} | |
AWS_DEFAULT_REGION: us-east-1 | |
APPZI_TOKEN: ${{ secrets.APPZI_TOKEN }} | |
MENDABLE_API_KEY: ${{ secrets.MENDABLE_API_KEY }} | |
FULLSTORY_ORGID: ${{ secrets.FULLSTORY_ORGID }} | |
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }} | |
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | |
ALGOLIA_SEARCH_KEY: ${{ secrets.ALGOLIA_SEARCH_KEY }} | |
concurrency: | |
group: production-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build Website | |
runs-on: | |
group: Default | |
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] | |
runs-on: ubuntu-latest | |
steps: | |
- id: checkout | |
name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Nodejs | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- name: "release" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npx semantic-release |