Push docs to root instead of /preview (#1351)

## Description

Push docs to root instead of /preview

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 💻 CI/Deployment
- [ ] 🐹 Trivial/Minor

## Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* fixes https://github.com/alcionai/corso/issues/1327

## Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
Abin Simon 2022-10-28 09:59:07 +05:30 committed by GitHub
parent a7d9170c61
commit 8900f6dff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,10 +2,10 @@ name: Build/Release Corso
on: on:
workflow_dispatch: workflow_dispatch:
pull_request: pull_request:
branches: [ main ] branches: [main]
push: push:
branches: [ main ] branches: [main]
tags: [ 'v*.*.*' ] tags: ["v*.*.*"]
permissions: permissions:
# required to retrieve AWS credentials # required to retrieve AWS credentials
@ -20,7 +20,6 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------
# --- Prechecks and Checkouts ------------------------------------------------------------------------ # --- Prechecks and Checkouts ------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------
@ -138,7 +137,7 @@ jobs:
AZURE_CLIENT_ID: ${{ secrets.CLIENT_ID }} AZURE_CLIENT_ID: ${{ secrets.CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} AZURE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }} AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
CORSO_CI_TESTS: true CORSO_CI_TESTS: true
CORSO_M356_TEST_USER_ID: ${{ secrets.CORSO_M356_TEST_USER_ID }} CORSO_M356_TEST_USER_ID: ${{ secrets.CORSO_M356_TEST_USER_ID }}
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }} CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
run: | run: |
@ -227,8 +226,6 @@ jobs:
echo "::set-output name=version::$(echo unreleased-$(git rev-parse --short HEAD))" echo "::set-output name=version::$(echo unreleased-$(git rev-parse --short HEAD))"
fi fi
Publish-Binary: Publish-Binary:
needs: [Test-Suite, Linting, Docs-Linting, SetEnv] needs: [Test-Suite, Linting, Docs-Linting, SetEnv]
environment: ${{ needs.SetEnv.outputs.environment }} environment: ${{ needs.SetEnv.outputs.environment }}
@ -241,7 +238,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
fetch-depth: 0 # needed to pull changelog fetch-depth: 0 # needed to pull changelog
- name: Setup Golang with cache - name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v3 uses: magnetikonline/action-golang-cache@v3
@ -297,13 +294,17 @@ jobs:
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }} CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
run: | run: |
npm ci npm ci
CORSO_DOCS_BASEURL="/preview/" npm run build # TODO: update base url once finalized npm run build
- name: Add rotbots.txt
if: github.ref == 'refs/heads/main'
run: |
printf 'User-agent: *\nDisallow: /' > build/robots.txt
- name: Push docs - name: Push docs
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
run: | run: |
echo "$DOCS_BUCKET" | base64 aws s3 sync build "s3://${{ secrets.DOCS_S3_BUCKET }}"
aws s3 sync build "s3://${{ secrets.DOCS_S3_BUCKET }}/preview"
- name: Invalidate cloudfront - name: Invalidate cloudfront
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'