diff --git a/.github/workflows/build-api.yml b/.github/workflows/build-api.yml index c60bb8e84..40efbeb89 100644 --- a/.github/workflows/build-api.yml +++ b/.github/workflows/build-api.yml @@ -69,3 +69,7 @@ jobs: docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG" + + - name: Set build status + id: set_build_status + run: echo "::set-output name=build_status::success" diff --git a/.github/workflows/build-embed.yml b/.github/workflows/build-embed.yml index 3e580ce47..ac0e5a896 100644 --- a/.github/workflows/build-embed.yml +++ b/.github/workflows/build-embed.yml @@ -2,7 +2,9 @@ name: Publish Embed to Production on: workflow_call: - workflow_dispatch: + secrets: + GH_PACKAGES: + required: true jobs: build_embed: @@ -10,39 +12,15 @@ jobs: # The type of runner that the job will run on runs-on: ubuntu-latest timeout-minutes: 80 - environment: Production + # environment: Production permissions: contents: read packages: write deployments: write steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - name: Setup kernel for react native, increase watchers - run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - - - uses: actions/setup-node@v2 - with: - node-version: '20.13.1' - - - name: Cache pnpm modules - uses: actions/cache@v2 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - - uses: pnpm/action-setup@v2.0.1 - env: - CI: false - with: - version: 8.9.0 - run_install: true - - name: Build run: pnpm run --filter @impler/embed build:prod - + - name: Build, tag, and push image to Github Container Registry id: build-image env: @@ -61,3 +39,7 @@ jobs: docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG" + + - name: Set build status + id: set_build_status + run: echo "::set-output name=build_status::success" \ No newline at end of file diff --git a/.github/workflows/deploy-quality.yaml b/.github/workflows/deploy-quality.yaml index 865af2d48..7cd275f8c 100644 --- a/.github/workflows/deploy-quality.yaml +++ b/.github/workflows/deploy-quality.yaml @@ -14,6 +14,8 @@ jobs: # if: ${{ github.event_name == 'push' && (github.event.head_commit.modified || github.event.head_commit.added || github.event.head_commit.removed) && contains(toJSON(github.event.head_commit.modified), 'apps/api/') }} uses: ./.github/workflows/build-api.yml secrets: inherit + outputs: + build_status: ${{ steps.build_status.outcome == 'success' }} build_embed: permissions: @@ -22,39 +24,43 @@ jobs: deployments: write if: ${{ github.event_name == 'push' && (github.event.head_commit.modified || github.event.head_commit.added || github.event.head_commit.removed) && contains(toJSON(github.event.head_commit.modified), 'apps/demo/') }} uses: ./.github/workflows/build-embed.yml + secrets: inherit + outputs: + build_status: ${{ steps.build_status.outcome == 'success' }} - build_queuemanager: - permissions: - contents: read - packages: write - deployments: write - if: ${{ github.event_name == 'push' && (github.event.head_commit.modified || github.event.head_commit.added || github.event.head_commit.removed) && contains(toJSON(github.event.head_commit.modified), 'apps/queue-manager/') }} - uses: ./.github/workflows/build-queuemanager.yml + # build_queuemanager: + # permissions: + # contents: read + # packages: write + # deployments: write + # if: ${{ github.event_name == 'push' && (github.event.head_commit.modified || github.event.head_commit.added || github.event.head_commit.removed) && contains(toJSON(github.event.head_commit.modified), 'apps/queue-manager/') }} + # uses: ./.github/workflows/build-queuemanager.yml - build_web: - permissions: - contents: read - packages: write - deployments: write - if: ${{ github.event_name == 'push' && (github.event.head_commit.modified || github.event.head_commit.added || github.event.head_commit.removed) && contains(toJSON(github.event.head_commit.modified), 'apps/web/') }} - uses: ./.github/workflows/build-web.yml + # build_web: + # permissions: + # contents: read + # packages: write + # deployments: write + # if: ${{ github.event_name == 'push' && (github.event.head_commit.modified || github.event.head_commit.added || github.event.head_commit.removed) && contains(toJSON(github.event.head_commit.modified), 'apps/web/') }} + # uses: ./.github/workflows/build-web.yml - build_widget: - permissions: - contents: read - packages: write - deployments: write - if: ${{ github.event_name == 'push' && (github.event.head_commit.modified || github.event.head_commit.added || github.event.head_commit.removed) && contains(toJSON(github.event.head_commit.modified), 'apps/widget/') }} - uses: ./.github/workflows/build-widget.yml + # build_widget: + # permissions: + # contents: read + # packages: write + # deployments: write + # if: ${{ github.event_name == 'push' && (github.event.head_commit.modified || github.event.head_commit.added || github.event.head_commit.removed) && contains(toJSON(github.event.head_commit.modified), 'apps/widget/') }} + # uses: ./.github/workflows/build-widget.yml deploy_with_ssh: runs-on: ubuntu-latest needs: - build_api - build_embed - - build_queuemanager - - build_web - - build_widget + # - build_queuemanager + # - build_web + # - build_widget + if: needs.build_api.outputs.build_status == 'true' || needs.build_embed.outputs.build_status == 'true' steps: - name: Set up SSH and Run Docker Compose Up uses: webfactory/ssh-agent@v0.5.3