Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create deploy-prod.yaml #625

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/deploy-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Deploy Impler to Quality

on:
pull_request:
branches: [next]
types:
- closed

jobs:
build_api:
permissions:
contents: read
packages: write
deployments: write
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'impler/api')) }}
uses: ./.github/workflows/build-api.yml
secrets: inherit

build_embed:
permissions:
contents: read
packages: write
deployments: write
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'impler/embed')) }}
uses: ./.github/workflows/build-embed.yml
secrets: inherit

build_queuemanager:
permissions:
contents: read
packages: write
deployments: write
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'impler/queuemanager')) }}
uses: ./.github/workflows/build-queuemanager.yml
secrets: inherit

build_web:
permissions:
contents: read
packages: write
deployments: write
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'impler/web')) }}
uses: ./.github/workflows/build-web.yml
secrets: inherit

build_widget:
permissions:
contents: read
packages: write
deployments: write
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'impler/widget')) }}
uses: ./.github/workflows/build-widget.yml
secrets: inherit

tag_images:
permissions:
contents: read
packages: write
deployments: write
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'impler/itag')) }}
uses: ./.github/workflows/tag-images.yml
secrets: inherit

publish_npm:
permissions:
contents: read
packages: write
deployments: write
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'impler/inpm')) }}
uses: ./.github/workflows/publish-prod-packages.yml
secrets: inherit

deploy_with_ssh:
runs-on: ubuntu-latest
needs:
- build_api
- build_embed
- build_queuemanager
- build_web
- build_widget
- tag_images
- publish_npm
if: |
always() &&
(needs.build_api.result == 'success' || needs.build_embed.result == 'success' || needs.build_queuemanager.result == 'success' || needs.build_web.result == 'success' || needs.build_widget.result == 'success' || needs.tag_images.result == 'success' || needs.publish_npm.result == 'success')
steps:
- name: Set up SSH and Run Docker Compose Up
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_QA }}
- name: Run Docker Compose Up
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME_QA }}@${{ secrets.SSH_HOST_QA }} \
"cd ${{ secrets.SSH_PATH_QA }} && docker compose up -d"
Loading