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

ci: remove web assets from API Docker image #1293

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
13 changes: 0 additions & 13 deletions .github/workflows/build_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,6 @@ jobs:
echo "::set-output name=platforms::$PLATFORMS"
echo "::set-output name=version::$VERSION"
echo "::set-output name=tags::$TAGS"
- name: Fetch reearth-cms-web
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: ci_web.yml
workflow_conclusion: success
branch: main
name: reearth-cms-web
path: server
check_artifacts: true
search_artifacts: true
- name: Extract reearth-cms-web
run: tar -xvf server/reearth-cms-web.tar.gz; mv reearth-cms-web server/web; ls
- name: Build and push docker image
uses: docker/build-push-action@v6
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/ci_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@ jobs:
run: yarn i18n --fail-on-update
- name: Build
run: yarn build

# TODO: Remove after dockerizing the web.
- name: Pack
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/release'
run: mv dist reearth-cms-web && tar -zcvf reearth-cms-web.tar.gz reearth-cms-web

# TODO: Remove after dockerizing the web.
- uses: actions/upload-artifact@v4
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/release'
with:
name: reearth-cms-web
path: web/reearth-cms-web.tar.gz
if-no-files-found: error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These steps can remain beccause it is helpful to investigate issue on build results.

if-no-files-found: error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add newline at end of file.

Add a newline character at the end of the file to comply with POSIX standards.

   if-no-files-found: error
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if-no-files-found: error
if-no-files-found: error
🧰 Tools
🪛 yamllint

[error] 41-41: no new line character at the end of file

(new-line-at-end-of-file)

39 changes: 0 additions & 39 deletions .github/workflows/deploy_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ concurrency:
env:
GCP_REGION: us-central1

# TODO: Remove after dockerizing the web.
GCS_DEST: gs://cms.test.reearth.dev

# server
SERVER_IMAGE: reearth/reearth-cms:nightly
SERVER_IMAGE_NAME: us-central1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/reearth/reearth-cms:nightly
Expand All @@ -29,42 +26,6 @@ env:
WORKER_IMAGE_GCP: us-central1-docker.pkg.dev/reearth-oss/reearth/reearth-cms-worker:nightly

jobs:
# TODO: Remove after dockerizing the web.
deploy_web_gcs:
name: Deploy web to test env
if: github.event.repository.full_name == 'reearth/reearth-cms' && github.event.workflow_run.name == 'ci-web' && github.event.workflow_run.conclusion != 'failure' && github.event.workflow_run.head_branch == 'main'
runs-on: ubuntu-latest
permissions:
contents: read # To checkout
id-token: write # To authenticate with Google Cloud using OIDC
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: get latest web artifact
uses: dawidd6/[email protected]
with:
github_token: ${{ steps.app-token.outputs.token }}
workflow: ci_web.yml
workflow_conclusion: success
branch: main
name: reearth-cms-web
check_artifacts: true
search_artifacts: true
- name: Extract
run: tar -xvf reearth-cms-web.tar.gz
- uses: google-github-actions/auth@v2
with:
service_account: ${{ secrets.GCP_SA_EMAIL }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Deploy
run: gsutil -m -h "Cache-Control:no-store" rsync -x "^reearth_config\\.json$" -dr reearth-cms-web/ $GCS_DEST

deploy_server:
name: Deploy server to test env
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/mime.types /etc/mime.types
COPY --from=build /app/reearth-cms /app/reearth-cms
COPY web* /app/web/

WORKDIR /app

Expand Down
Loading