Add auto expand capability #41
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 website and admin panel on s3 | |
on: | |
push: | |
branches: | |
- deploy-website-using-s3 | |
jobs: | |
build-and-deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "20.x" | |
- name: Install dependencies and Build website | |
run: | | |
cd website | |
npm install | |
sed -i "s|SUPABASE_URL_VALUE|${{ secrets.SUPABASE_URL }}|g" config.js | |
sed -i "s|SUPABASE_ANON_KEY_VALUE|${{ secrets.SUPABASE_ANON_KEY }}|g" config.js | |
npm run build | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Build and copy zip to S3 | |
run: | | |
cd website | |
sed -i "s|SUPABASE_URL_VALUE|${{ secrets.SUPABASE_URL }}|g" config.js | |
sed -i "s|SUPABASE_ANON_KEY_VALUE|${{ secrets.SUPABASE_ANON_KEY }}|g" config.js | |
npm install && npm run build | |
cd .next && zip bitespace_website_SSR_${{ github.sha }}-${{ github.run_attempt }}.zip -r . && aws s3 cp bitespace_website_SSR_${{ github.sha }}-${{ github.run_attempt }}.zip s3://bitespace-lambda-handlers && cd .. | |
aws s3 rm s3://bitespace-website-ssr --recursive | |
aws s3 sync ./.next s3://bitespace-website-ssr | |
- name: Deploy cloudformation stack | |
id: bitespace-website-lambda-stack | |
uses: aws-actions/aws-cloudformation-github-deploy@v1 | |
with: | |
name: bitespace-website-lambda-stack | |
template: website/deploy.yml | |
capabilities: CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND | |
timeout-in-minutes: "10" | |
no-fail-on-empty-changeset: "1" | |
parameter-overrides: >- | |
ZipFileName=bitespace_website_SSR_${{ github.sha }}-${{ github.run_attempt }}.zip |