chore: update npm dependencies #379
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: [main, release] | |
| pull_request: | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed_server: ${{ steps.server.outputs.any_modified }} | |
| changed_web: ${{ steps.web.outputs.any_modified }} | |
| build: ${{ steps.prepare.outputs.build }} | |
| sha_short: ${{ steps.prepare.outputs.sha_short }} | |
| new_tag: ${{ steps.prepare.outputs.new_tag }} | |
| new_tag_short: ${{ steps.prepare.outputs.new_tag_short }} | |
| name: ${{ steps.prepare.outputs.name }} | |
| steps: | |
| - uses: reearth/actions/prepare-build@e05fcd1efc6c985c7c0c906cff1452ee634232c8 # main | |
| id: prepare | |
| with: | |
| repo: ${{ github.repository }} | |
| - name: changed files for server | |
| id: server | |
| uses: step-security/changed-files@95b56dadb92a30ca9036f16423fd3c088a71ee94 # v46.0.5 | |
| with: | |
| files: | | |
| server/** | |
| .github/workflows/ci.yml | |
| .github/workflows/ci-server.yml | |
| - name: changed files for web | |
| id: web | |
| uses: step-security/changed-files@95b56dadb92a30ca9036f16423fd3c088a71ee94 # v46.0.5 | |
| with: | |
| files: | | |
| web/** | |
| .github/workflows/ci.yml | |
| .github/workflows/ci-web.yml | |
| ci-server: | |
| needs: prepare | |
| if: needs.prepare.outputs.changed_server == 'true' | |
| uses: ./.github/workflows/ci-server.yml | |
| ci-web: | |
| needs: prepare | |
| if: needs.prepare.outputs.changed_web == 'true' | |
| uses: ./.github/workflows/ci-web.yml | |
| build-server: | |
| needs: [prepare, ci-server] | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| if: needs.prepare.outputs.build && needs.prepare.outputs.changed_server == 'true' | |
| outputs: | |
| digest: ${{ steps.build-docker-image.outputs.image }} | |
| steps: | |
| - uses: reearth/actions/build-docker-image@e05fcd1efc6c985c7c0c906cff1452ee634232c8 | |
| id: build-docker-image | |
| with: | |
| image: ${{ secrets.IMAGE_SERVER }} | |
| context: server | |
| use_dockerhub: false | |
| name: ${{ needs.prepare.outputs.name }} | |
| new_tag: ${{ needs.prepare.outputs.new_tag }} | |
| new_tag_short: ${{ needs.prepare.outputs.new_tag_short }} | |
| sha_short: ${{ needs.prepare.outputs.sha_short }} | |
| build-web: | |
| needs: [prepare, ci-web] | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| if: needs.prepare.outputs.build && needs.prepare.outputs.changed_web == 'true' | |
| outputs: | |
| digest: ${{ steps.build-docker-image.outputs.image }} | |
| steps: | |
| - uses: reearth/actions/build-docker-image@e05fcd1efc6c985c7c0c906cff1452ee634232c8 | |
| id: build-docker-image | |
| with: | |
| image: ${{ secrets.IMAGE_WEB }} | |
| context: web | |
| use_dockerhub: false | |
| name: ${{ needs.prepare.outputs.name }} | |
| new_tag: ${{ needs.prepare.outputs.new_tag }} | |
| new_tag_short: ${{ needs.prepare.outputs.new_tag_short }} | |
| sha_short: ${{ needs.prepare.outputs.sha_short }} | |
| build-web-pr: | |
| needs: [prepare, ci-web] | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| if: ${{ needs.prepare.outputs.changed_web == 'true' && github.event_name == 'pull_request' && github.base_ref == 'main' && (github.event.action == 'opened' || github.event.action == 'synchronize') }} | |
| outputs: | |
| digest: ${{ steps.build-docker-image.outputs.image }} | |
| steps: | |
| - uses: reearth/actions/build-docker-image@e05fcd1efc6c985c7c0c906cff1452ee634232c8 # main | |
| id: build-docker-image | |
| with: | |
| image: ${{ secrets.IMAGE_WEB }} | |
| context: web | |
| use_dockerhub: false | |
| name: ${{ needs.prepare.outputs.sha_short }} | |
| new_tag: ${{ needs.prepare.outputs.new_tag }} | |
| new_tag_short: ${{ needs.prepare.outputs.new_tag_short }} | |
| sha_short: ${{ needs.prepare.outputs.sha_short }} | |
| deploy-web-pr: | |
| needs: [build-web-pr, prepare] | |
| runs-on: ubuntu-latest | |
| outputs: | |
| preview_url: ${{ steps.deploy.outputs.url }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| issues: write | |
| packages: write | |
| pull-requests: write | |
| steps: | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| - uses: reearth/actions/deploy-cloud-run-with-tag@e05fcd1efc6c985c7c0c906cff1452ee634232c8 # main | |
| id: deploy | |
| with: | |
| image: '${{ secrets.IMAGE_WEB }}:${{ needs.prepare.outputs.sha_short }}' | |
| image_internal: '${{ secrets.IMAGE_WEB_GC }}:${{ needs.prepare.outputs.sha_short }}' | |
| region: ${{ secrets.GC_REGION }} | |
| service: reearth-scaffold-web | |
| service_account: ${{ secrets.GC_SA_EMAIL }} | |
| tag: pr-${{ github.event.pull_request.number }} | |
| workload_identity_provider: ${{ secrets.GC_WORKLOAD_IDENTITY_PROVIDER }} | |
| deploy-server: | |
| needs: [build-server] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| steps: | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: reearth/actions/deploy-cloud-run@e05fcd1efc6c985c7c0c906cff1452ee634232c8 # main | |
| with: | |
| service: reearth-scaffold-api | |
| image: '${{ secrets.IMAGE_SERVER }}:latest' | |
| image_internal: '${{ secrets.IMAGE_SERVER_GC }}:latest' | |
| region: ${{ secrets.GC_REGION }} | |
| service_account: ${{ secrets.GC_SA_EMAIL }} | |
| workload_identity_provider: ${{ secrets.GC_WORKLOAD_IDENTITY_PROVIDER }} | |
| deploy-web: | |
| needs: [build-web] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| steps: | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: reearth/actions/deploy-cloud-run@e05fcd1efc6c985c7c0c906cff1452ee634232c8 # main | |
| with: | |
| service: reearth-scaffold-web | |
| image: '${{ secrets.IMAGE_WEB }}:latest' | |
| image_internal: '${{ secrets.IMAGE_WEB_GC }}:latest' | |
| region: ${{ secrets.GC_REGION }} | |
| service_account: ${{ secrets.GC_SA_EMAIL }} | |
| workload_identity_provider: ${{ secrets.GC_WORKLOAD_IDENTITY_PROVIDER }} |