Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
node-version: 20

- name: Get yarn cache
uses: actions/cache@v2
uses: actions/cache@v4
id: yarn-cache
with:
path: |
Expand All @@ -45,6 +45,9 @@ jobs:
deploy-preview:
runs-on: ubuntu-latest
name: deploy-preview
permissions:
contents: read
id-token: write
steps:
- name: Check out Git repository
uses: actions/checkout@v3
Expand All @@ -55,7 +58,7 @@ jobs:
node-version: 20

- name: Get yarn cache
uses: actions/cache@v2
uses: actions/cache@v4
id: yarn-cache
with:
path: |
Expand All @@ -82,12 +85,20 @@ jobs:
- run: yarn add -W @typeform/jarvis
- run: git checkout HEAD -- package.json # do not save jarvis dependency to package.json because it is private (the file is committed by semantic-release to bump version)

# authenticate to AWS
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: 'us-east-1'
mask-aws-account-id: true
role-to-assume: ${{ secrets.DEPLOYMENT_ROLE_ARN }}
role-session-name: ${{ github.run_id }}-${{ github.run_attempt }}
role-duration-seconds: 900
unset-current-credentials: true

# deploy preview version of the package
- run: yarn release:aws --preview --notify-preview
env:
AWS_ASSETS_BUCKET: 'typeform-public-assets/btn'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
JARVIS_NOTIFY_PREVIEW_TEMPLATE: ${{ secrets.JARVIS_NOTIFY_PREVIEW_TEMPLATE }}
PUBLIC_CDN_URL: 'https://btn.typeform.com'
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
steps:
- name: Check out Git repository
uses: actions/checkout@v3
Expand All @@ -18,7 +22,7 @@ jobs:
node-version: 20

- name: Get yarn cache
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: |
Expand Down Expand Up @@ -47,12 +51,20 @@ jobs:
- run: yarn add -W @typeform/jarvis
- run: git checkout HEAD -- package.json # do not save jarvis dependency to package.json because it is private (the file is committed by semantic-release to bump version)

# authenticate to AWS
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: 'us-east-1'
mask-aws-account-id: true
role-to-assume: ${{ secrets.DEPLOYMENT_ROLE_ARN }}
role-session-name: ${{ github.run_id }}-${{ github.run_attempt }}
role-duration-seconds: 900
unset-current-credentials: true

- run: yarn release
env:
AWS_ASSETS_BUCKET: 'typeform-public-assets/btn'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_CLOUDFRONT_DIST: 'E3IUO95IYL1RI3'
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
JARVIS_NOTIFY_PREVIEW_TEMPLATE: ${{ secrets.JARVIS_NOTIFY_PREVIEW_TEMPLATE }}
Expand Down