Skip to content

Manual Deploy [ssr-web] #176

Manual Deploy [ssr-web]

Manual Deploy [ssr-web] #176

Workflow file for this run

name: Manual Deploy [ssr-web]
on:
workflow_dispatch:
inputs:
environment:
description: Deployment environment
required: false
default: staging
workflow_call:
inputs:
environment:
required: false
type: string
default: staging
permissions:
contents: read
id-token: write
jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest
outputs:
image: ${{ steps.docker-ecr.outputs.tag_sha }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/init
- name: Set up env
env:
INPUT_ENVIRONMENT: ${{ inputs.environment }}
run: |
if [ "$INPUT_ENVIRONMENT" = "production" ]; then
echo "HUB_URL=https://hub.cardstack.com" >> $GITHUB_ENV
elif [ "$INPUT_ENVIRONMENT" = "staging" ]; then
echo "HUB_URL=https://hub-staging.stack.cards" >> $GITHUB_ENV
else
echo "unrecognized environment"
exit 1;
fi
- name: Build
env:
SENTRY_DSN: ${{ secrets.SSR_WEB_CLIENT_SENTRY_DSN }}
SSR_WEB_ENVIRONMENT: ${{ inputs.environment }}
run: yarn build:ssr-web:${{ inputs.environment }}
- name: Move dist content
run: mv dist deployment/
working-directory: packages/ssr-web
- uses: cardstack/gh-actions/docker-ecr@main
id: docker-ecr
with:
repository: "ssr-web-${{ inputs.environment }}"
environment: ${{ inputs.environment }}
dockerfile: "packages/ssr-web/deployment/Dockerfile"
context: "packages/ssr-web/deployment"
deploy:
needs: [build]
name: Deploy to AWS ECS
uses: cardstack/gh-actions/.github/workflows/ecs-deploy.yml@main
secrets: inherit
with:
container-name: "ssr-web"
environment: ${{ inputs.environment }}
cluster: ${{ inputs.environment }}
service-name: "ssr-web-${{ inputs.environment }}"
image: ${{ needs.build.outputs.image }}