|
| 1 | +name: Deploy |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + id-token: write |
| 11 | + contents: read |
| 12 | + |
| 13 | +jobs: |
| 14 | + release: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + if: github.repository_owner == 'tilt-dev' |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Setup Ruby |
| 22 | + uses: ruby/setup-ruby@v1 |
| 23 | + with: |
| 24 | + ruby-version: 3.2.0 |
| 25 | + bundler-cache: true |
| 26 | + - name: Install dependencies |
| 27 | + run: | |
| 28 | + bundle install |
| 29 | +
|
| 30 | + - name: Check for changes |
| 31 | + id: paths |
| 32 | + uses: dorny/paths-filter@v2 |
| 33 | + with: |
| 34 | + filters: | |
| 35 | + blog: |
| 36 | + - 'blog/**' |
| 37 | + - '.github/**' |
| 38 | + - 'base/**' |
| 39 | + docs: |
| 40 | + - 'docs/**' |
| 41 | + - '.github/**' |
| 42 | + - 'base/**' |
| 43 | + site: |
| 44 | + - 'src/**' |
| 45 | + - '.github/**' |
| 46 | + - 'base/**' |
| 47 | +
|
| 48 | + # Deploy blog.tilt.dev |
| 49 | + - name: Configure AWS credentials to access blog.tilt.dev |
| 50 | + uses: aws-actions/configure-aws-credentials@v3 |
| 51 | + if: steps.paths.outputs.blog == 'true' |
| 52 | + with: |
| 53 | + role-to-assume: arn:aws:iam::710015040892:role/prod-collaboration-blog.tilt.dev-20250228142654978300000003 |
| 54 | + aws-region: us-east-1 |
| 55 | + |
| 56 | + - name: Create website blog.tilt.dev |
| 57 | + if: steps.paths.outputs.blog == 'true' |
| 58 | + run: | |
| 59 | + JEKYLL_ENV=production bundle exec jekyll build -s blog -d blog/_site |
| 60 | + - name: Deploy website blog.tilt.dev |
| 61 | + if: steps.paths.outputs.blog == 'true' |
| 62 | + run: | |
| 63 | + aws s3 sync blog/_site s3://prod-collaboration-blog.tilt.dev/ --region us-east-1 --delete |
| 64 | + - name: Invalidate CloudFront cache for blog.tilt.dev |
| 65 | + if: steps.paths.outputs.blog == 'true' |
| 66 | + run: | |
| 67 | + aws cloudfront create-invalidation --distribution-id E3N3T1RV0AK16L --paths "/*" |
| 68 | +
|
| 69 | + # Deploy docs.tilt.dev |
| 70 | + - name: Configure AWS credentials to access docs.tilt.dev |
| 71 | + uses: aws-actions/configure-aws-credentials@v3 |
| 72 | + if: steps.paths.outputs.docs == 'true' |
| 73 | + with: |
| 74 | + role-to-assume: arn:aws:iam::710015040892:role/prod-collaboration-docs.tilt.dev-20250228142654979400000004 |
| 75 | + aws-region: us-east-1 |
| 76 | + - name: Create website docs.tilt.dev |
| 77 | + if: steps.paths.outputs.docs == 'true' |
| 78 | + run: | |
| 79 | + JEKYLL_ENV=production bundle exec jekyll build -s docs -d docs/_site |
| 80 | + - name: Deploy website docs.tilt.dev |
| 81 | + if: steps.paths.outputs.docs == 'true' |
| 82 | + run: | |
| 83 | + aws s3 sync docs/_site s3://prod-collaboration-docs.tilt.dev/ --region us-east-1 --delete |
| 84 | + - name: Invalidate CloudFront cache for docs.tilt.dev |
| 85 | + if: steps.paths.outputs.docs == 'true' |
| 86 | + run: | |
| 87 | + aws cloudfront create-invalidation --distribution-id E1EL5SJ56F1K8Q --paths "/*" |
| 88 | +
|
| 89 | + # Deploy www.tilt.dev |
| 90 | + - name: Configure AWS credentials to access www.tilt.dev |
| 91 | + uses: aws-actions/configure-aws-credentials@v3 |
| 92 | + if: steps.paths.outputs.site == 'true' |
| 93 | + with: |
| 94 | + role-to-assume: arn:aws:iam::710015040892:role/prod-collaboration-tilt.dev-20250228142654974200000002 |
| 95 | + aws-region: us-east-1 |
| 96 | + - name: Create website www.tilt.dev |
| 97 | + if: steps.paths.outputs.site == 'true' |
| 98 | + run: | |
| 99 | + JEKYLL_ENV=production bundle exec jekyll build -s src -d src/_site |
| 100 | + - name: Deploy website www.tilt.dev |
| 101 | + if: steps.paths.outputs.site == 'true' |
| 102 | + run: | |
| 103 | + aws s3 sync src/_site s3://prod-collaboration-tilt.dev/ --region us-east-1 --delete |
| 104 | + - name: Invalidate CloudFront cache for www.tilt.dev |
| 105 | + if: steps.paths.outputs.site == 'true' |
| 106 | + run: | |
| 107 | + aws cloudfront create-invalidation --distribution-id E34ACMVUMLXEP6 --paths "/*" |
0 commit comments