Merge pull request #18 from Real-Life-IaC/fix-kwargs #79
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- labeled | |
- synchronize | |
permissions: | |
id-token: write | |
jobs: | |
deploy-sandbox: | |
name: Sandbox Deploy | |
if: | | |
(github.event.action == 'labeled' && github.event.label.name == ':test_tube: sandbox deploy') || | |
(github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, ':test_tube: sandbox deploy')) || | |
(github.event_name == 'push' && github.ref_name == 'main') | |
environment: sandbox | |
concurrency: sandbox | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Node Dependencies and Build React App | |
shell: bash | |
run: | | |
cd app | |
npm install | |
npm run build | |
env: | |
VITE_API_URL: ${{ vars.API_URL }} | |
- name: Deploy Stack | |
uses: ./.github/actions/deploy | |
with: | |
role-to-assume: ${{ vars.ROLE_TO_ASSUME }} | |
aws-region: ${{ vars.AWS_REGION }} | |
stack-name: Frontend-sandbox | |
deploy-staging: | |
if: github.ref_name == 'main' | |
name: Staging Deploy | |
environment: staging | |
concurrency: staging | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Node Dependencies and Build React App | |
shell: bash | |
run: | | |
cd app | |
npm install | |
npm run build | |
env: | |
VITE_API_URL: ${{ vars.API_URL }} | |
- name: Deploy Stack | |
uses: ./.github/actions/deploy | |
with: | |
role-to-assume: ${{ vars.ROLE_TO_ASSUME }} | |
aws-region: ${{ vars.AWS_REGION }} | |
stack-name: Frontend-staging | |
deploy-production: | |
if: github.ref_name == 'main' | |
name: Production Deploy | |
environment: production | |
concurrency: production | |
runs-on: ubuntu-latest | |
needs: | |
- deploy-sandbox | |
- deploy-staging | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Node Dependencies and Build React App | |
shell: bash | |
run: | | |
cd app | |
npm install | |
npm run build | |
env: | |
VITE_API_URL: ${{ vars.API_URL }} | |
- name: Deploy Stack | |
uses: ./.github/actions/deploy | |
with: | |
role-to-assume: ${{ vars.ROLE_TO_ASSUME }} | |
aws-region: ${{ vars.AWS_REGION }} | |
stack-name: Frontend-production |