Skip to content

chore: reusable workflow #67

chore: reusable workflow

chore: reusable workflow #67

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
env:
AWS_ACCOUNT_ID: 590184101838
AWS_REGION: us-east-1
AWS_APP: stevezelek-com
NODE_VERSION: 16
BUILD_DIR: public
CLOUDFLARE_ZONE: c272b1a950675498138a374bcbf3fe0f
jobs:
env:
runs-on: ubuntu-latest
outputs:
AWS_ACCOUNT_ID: ${{ env.AWS_ACCOUNT_ID }}
AWS_REGION: ${{ env.AWS_REGION }}
AWS_APP: ${{ env.AWS_APP }}
NODE_VERSION: ${{ env.NODE_VERSION }}
BUILD_DIR: ${{ env.BUILD_DIR }}
CLOUDFLARE_ZONE: ${{ env.CLOUDFLARE_ZONE }}
steps:
- run: echo ""
build:
needs: [env]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache NPM
uses: actions/setup-node@v3
with:
node-version: ${{ needs.env.outputs.NODE_VERSION }}
cache: 'npm'
- name: Install
run: |
npm ci
npm run build:app
- name: Upload frontend artifact
uses: actions/upload-artifact@v4
with:
name: ${{ needs.env.outputs.AWS_APP }}
path: ${{ needs.env.outputs.BUILD_DIR }}/*
deploy-frontend:
needs: [env, build]
uses: smzelek/aws-hosting/.github/workflows/deploy-frontend.yml@main
secrets: inherit
with:
aws-account-id: ${{ needs.env.outputs.AWS_ACCOUNT_ID }}
aws-app: ${{ needs.env.outputs.AWS_APP }}
aws-region: ${{ needs.env.outputs.AWS_REGION }}
cloudflare-zone: ${{ needs.env.outputs.CLOUDFLARE_ZONE }}
frontend-artifact: ${{ needs.env.outputs.AWS_APP }}