Skip to content

DEV/PROD deploy - @devksingh4 #187

DEV/PROD deploy - @devksingh4

DEV/PROD deploy - @devksingh4 #187

Workflow file for this run

name: Deploy all resources to DEV and PROD
run-name: DEV/PROD deploy - @${{ github.actor }}
on:
workflow_dispatch:
push:
branches:
- main
jobs:
deploy-aws-dev:
runs-on: ubuntu-latest
concurrency:
group: resume-book-aws-dev
cancel-in-progress: false
environment: "AWS DEV"
name: Deploy to AWS DEV
steps:
- uses: actions/checkout@v3
- uses: aws-actions/setup-sam@v2
with:
use-installer: true
- uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- run: make deploy_dev
deploy-cf-pages-dev:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Deploy to Cloudflare Pages DEV
environment: "Cloudflare Pages - Dev"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node LTS
uses: actions/setup-node@v4
with:
node-version: 18
- name: Build
run: cd clientv2 && corepack enable && yarn && yarn run build
- name: Publish
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: resume-book-dev
directory: clientv2/dist/
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
test-dev:
runs-on: ubuntu-latest
needs:
- deploy-aws-dev
name: Perform live testing
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11 for testing
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Run live testing
run: make test_ci
deploy-aws-prod:
runs-on: ubuntu-latest
name: Deploy to AWS PROD
concurrency:
group: resume-book-aws-prod
cancel-in-progress: false
needs:
- test-dev
- deploy-aws-dev
environment: "AWS PROD"
steps:
- uses: actions/checkout@v3
- uses: aws-actions/setup-sam@v2
with:
use-installer: true
- uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- run: make deploy_prod
deploy-cf-pages-prod:
runs-on: ubuntu-latest
needs:
- test-dev
permissions:
contents: read
deployments: write
name: Deploy to Cloudflare Pages Prod
environment: "Cloudflare Pages - Prod"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node LTS
uses: actions/setup-node@v4
with:
node-version: 18
- name: Build
run: cd clientv2 && corepack enable && yarn && yarn run build
- name: Publish
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: resume-book-prod
directory: clientv2/dist/
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
health-check-prod:
runs-on: ubuntu-latest
name: Confirm services healthy
needs:
- deploy-aws-prod
- deploy-cf-pages-prod
steps:
- name: Call the API healthz endpoint
run: curl -f https://resume-api.acm.illinois.edu/api/v1/healthz
- name: Call the base UI endpoint
run: curl -f https://resumes.acm.illinois.edu