Skip to content

ci(server): mongo update 7 #8766

ci(server): mongo update 7

ci(server): mongo update 7 #8766

Workflow file for this run

name: ci
on:
push:
branches: [main, release/*, release]
pull_request:
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
web: ${{ steps.web.outputs.any_modified }}
server: ${{ steps.server.outputs.any_modified }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: changed files for web
id: web
uses: tj-actions/changed-files@v36
with:
files: |
web
.github/workflows/ci_web.yml
.github/workflows/build_web.yml
.github/workflows/deploy_web_nightly.yml
CHANGELOG.md
- name: changed files for server
id: server
uses: tj-actions/changed-files@v36
with:
files: |
server
.github/workflows/ci_server.yml
.github/workflows/build_server.yml
.github/workflows/deploy_server_nightly.yml
CHANGELOG.md
ci-web:
needs: prepare
if: needs.prepare.outputs.web == 'true'
uses: ./.github/workflows/ci_web.yml
ci-server:
needs: prepare
# server depends on web, so this should be triggered if web is modified
# TODO: Simplify "if" when we discontinue embedding front-end in the server
if: needs.prepare.outputs.server == 'true' || needs.prepare.outputs.web == 'true'
uses: ./.github/workflows/ci_server.yml
ci:
runs-on: ubuntu-latest
needs:
- ci-web
- ci-server
if: ${{ !failure() }}
steps:
- run: echo OK
build-prepare:
needs: prepare
if: ${{ github.repository == 'reearth/reearth-visualizer' && github.event_name == 'push' && (github.ref_name == 'release' || !startsWith(github.event.head_commit.message, 'v')) }}
uses: ./.github/workflows/build_prepare.yml
build-web:
needs: [ci-web, build-prepare]
uses: ./.github/workflows/build_web.yml
with:
sha_short: ${{ needs.build-prepare.outputs.sha_short }}
new_tag: ${{ needs.build-prepare.outputs.new_tag }}
new_tag_short: ${{ needs.build-prepare.outputs.new_tag_short }}
name: ${{ needs.build-prepare.outputs.name }}
sha: ${{ github.sha }}
secrets: inherit
build-web-post:
# needs build-web, but also this job should be triggered even if it was skipped
needs: [build-prepare, build-web]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- run: echo "OK"
build-server:
# required to trigger this job after build-web, but even if build-web is skipped
# TODO: Remove build-web-post from needs when we discontinue embedding front-end in the server
needs: [ci-server, build-prepare, build-web-post]
if: ${{ !cancelled() }}
#
uses: ./.github/workflows/build_server.yml
with:
sha_short: ${{ needs.build-prepare.outputs.sha_short }}
new_tag: ${{ needs.build-prepare.outputs.new_tag }}
new_tag_short: ${{ needs.build-prepare.outputs.new_tag_short }}
name: ${{ needs.build-prepare.outputs.name }}
sha: ${{ github.sha }}
secrets: inherit
# TODO: build_release workflow is broken
# TODO: Remove build-web-post from needs when we discontinue embedding front-end in the server
# build-release:
# needs: [ci-server, build-prepare, build-web-post]
# if: ${{ !cancelled() && needs.build-prepare.outputs.name != 'nightly' }}
# uses: ./.github/workflows/build_release.yml
# with:
# sha_short: ${{ needs.build-prepare.outputs.sha_short }}
# new_tag: ${{ needs.build-prepare.outputs.new_tag }}
# new_tag_short: ${{ needs.build-prepare.outputs.new_tag_short }}
# name: ${{ needs.build-prepare.outputs.name }}
# sha: ${{ github.sha }}
# secrets: inherit
deploy-web:
needs: build-web
uses: ./.github/workflows/deploy_web_nightly.yml
secrets: inherit
deploy-server:
needs: build-server
# due to the build_server "if" hack, this "if" is also required to trigger this job
# TODO: Remove "if" when we discontinue embedding front-end in the server
if: ${{ !cancelled() }}
uses: ./.github/workflows/deploy_server_nightly.yml
secrets: inherit