Add NEXT_PUBLIC_HOST_URL to production and staging environments (#414) #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to staging | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
name: Deploy to staging | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Install dependencies | |
shell: bash | |
run: pnpm install --frozen-lockfile | |
- name: Build app | |
shell: bash | |
run: pnpm build | |
env: | |
NEXT_PUBLIC_HOST_URL: 'https://docs.staging.5afe.dev' | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
# Deploy the main branch to staging | |
- name: Deploy to the staging S3 | |
if: github.ref == 'refs/heads/main' | |
env: | |
BUCKET: s3://${{ secrets.AWS_STAGING_BUCKET_NAME }}/current | |
run: bash ./.github/scripts/s3_upload.sh |