From fdbea0dcae945892904029d517470ee249093536 Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Wed, 16 Nov 2022 13:46:58 +0530 Subject: [PATCH] Website publish action (#1358) ## Description Triggered manually from actions page using [manual trigger](https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/). @vkamra ~We will need `WEBSITE_S3_BUCKET` and `WEBSITE_CF_DISTRIBUTION` in `Production` env for this to work.~ If you could add the s3 and cloudfront details to to GitHub secrets, I'll switch to using the secrets instead. ## Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [x] :computer: CI/Deployment - [ ] :hamster: Trivial/Minor ## Issue(s) * fixes https://github.com/alcionai/corso/issues/1329 ## Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- .github/workflows/website-publish.yml | 35 +++++++++++++++++++++++++++ website/Makefile | 3 ++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/website-publish.yml diff --git a/.github/workflows/website-publish.yml b/.github/workflows/website-publish.yml new file mode 100644 index 000000000..c25ca31a0 --- /dev/null +++ b/.github/workflows/website-publish.yml @@ -0,0 +1,35 @@ +name: Publish website +on: + workflow_dispatch: + +permissions: + # required to retrieve AWS credentials + id-token: write + contents: write + packages: write + pull-requests: read + +jobs: + Publish-Website: + environment: Production + runs-on: ubuntu-latest + defaults: + run: + working-directory: website + steps: + - uses: actions/checkout@v3 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ secrets.AWS_IAM_ROLE }} + role-session-name: integration-testing + aws-region: us-east-1 + + - name: Build docs image + run: | + make buildimage + + - name: Build & Publish docs + run: | + make publish \ No newline at end of file diff --git a/website/Makefile b/website/Makefile index 53f0adbe4..398a01596 100644 --- a/website/Makefile +++ b/website/Makefile @@ -22,7 +22,8 @@ build: publish: build docker run -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \ - -e AWS_SESSION_TOKEN --rm -v ${PWD}:/usr/src/website corso/website:latest \ + -e AWS_SESSION_TOKEN -e AWS_REGION \ + --rm -v ${PWD}:/usr/src/website corso/website:latest \ make sync sync: