Untitled

mail@pastecode.io avatar
unknown
plain_text
24 days ago
1.5 kB
5
Indexable
Never
name: Deploy manually

on:
  workflow_dispatch:
    inputs:
      environment:
        required: true
        default: staging
        type: string
      deploy-frontend:
        type: boolean
        description: Deploy frontend
        default: true
      deploy-backend:
        type: boolean
        description: Deploy backend
        default: true
      force-rebuild:
        type: boolean
        description: Build even if image exists in registry
        default: false
      
jobs:
  build_push_images:
    uses: ./.github/workflows/build-push.yml
    with:
      build-backend: ${{ github.event.inputs.environment != 'staging2' }}
      force-rebuild: ${{ github.event.inputs.force-rebuild == 'true' }}
      environment: ${{ github.event.inputs.environment }}
    secrets:
      gcp-key: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
      git-ssh-key: ${{ secrets.GIT_SSH_PRIVATE_KEY }}

  deploy:
    needs:
      - build_push_images
    uses: ./.github/workflows/deploy-reuse.yml
    with:
      environment: ${{ github.event.inputs.environment }}
      deploy-frontend: ${{ github.event.inputs.deploy-frontend == 'true' }}
      deploy-backend: ${{ github.event.inputs.deploy-backend == 'true' }}
    secrets:
      gcp-key: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
      aws-access-key: ${{ secrets.AWS_ACCESS_KEY_ID }}
      aws-secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      fastly-api-token: ${{ secrets.FASTLY_API_TOKEN }}
      slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
Leave a Comment