From fc7d075d4937a5c8f508baa8726c45b0f688fd45 Mon Sep 17 00:00:00 2001 From: Stefan Scherer Date: Tue, 4 Mar 2025 15:39:44 +0100 Subject: [PATCH 1/2] Deploy on S3 Signed-off-by: Stefan Scherer Signed-off-by: Nick Santos --- .github/workflows/deploy.yaml | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..20838a1 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,56 @@ +name: Deploy + +on: + push: + branches: + - main + workflow_dispatch: + + pull_request: + branches: + - main + +permissions: + id-token: write + contents: read + +jobs: + release: + runs-on: ubuntu-latest + if: github.repository_owner == 'tilt-dev' + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + git submodule init + git submodule update + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7.0 + bundler-cache: true + - name: Install dependencies + run: | + bundle install + working-directory: docs + + # Deploy api.tilt.dev + - name: Configure AWS credentials to access api.tilt.dev + uses: aws-actions/configure-aws-credentials@v3 + with: + role-to-assume: arn:aws:iam::710015040892:role/prod-collaboration-api.tilt.dev-20250228142654966700000001 + aws-region: us-east-1 + - name: Create website api.tilt.dev + run: | + JEKYLL_ENV=production bundle exec jekyll build -d _site + working-directory: docs + + - name: Deploy website api.tilt.dev + run: | + aws s3 sync docs/_site s3://prod-collaboration-api.tilt.dev/ --region us-east-1 --delete + - name: Invalidate CloudFront cache for api.tilt.dev + run: | + aws cloudfront create-invalidation --distribution-id E2ZQJPGT02CCGI --paths "/*" From b1a9f1dff31419dce53ab6a68ec796d464d59240 Mon Sep 17 00:00:00 2001 From: Stefan Scherer Date: Wed, 5 Mar 2025 10:59:32 +0100 Subject: [PATCH 2/2] Only run on main branch Signed-off-by: Stefan Scherer --- .github/workflows/deploy.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 20838a1..7983362 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -6,10 +6,6 @@ on: - main workflow_dispatch: - pull_request: - branches: - - main - permissions: id-token: write contents: read