Skip to content

Commit

Permalink
Debug workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
johnshaughnessy committed Nov 7, 2023
1 parent 6e2c6da commit a46d894
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
38 changes: 37 additions & 1 deletion .github/workflows/build-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,44 @@ on:
- main

jobs:
build_docker_image_track_base_client_builder:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Paths Changes Filter
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
lock:
- 'web-client/Dockerfile.base-builder'
- name: Authenticate with GCP service account
if: steps.changes.outputs.lock == 'true'
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}

- name: Set up Cloud SDK
if: steps.changes.outputs.lock == 'true'
uses: google-github-actions/setup-gcloud@v1

- name: Configure Docker to use Google Artifact Registry
if: steps.changes.outputs.lock == 'true'
run: gcloud auth configure-docker us-central1-docker.pkg.dev

- name: Build Base Builder Image
if: steps.changes.outputs.lock == 'true'
run: |
docker build -f web-client/Dockerfile.base-builder --target base-builder -t us-central1-docker.pkg.dev/hubs-dev-333333/ocho-osai/johnshaughnessy/track/track-client-base-builder .
docker push us-central1-docker.pkg.dev/hubs-dev-333333/ocho-osai/johnshaughnessy/track/track-client-base-builder
build_docker_image_track_client_builder:
runs-on: ubuntu-latest
needs: build_docker_image_track_base_client_builder

steps:
- name: Checkout code
Expand All @@ -22,7 +58,7 @@ jobs:
- 'web-client/Cargo.lock'
- 'web-client/Dockerfile.builder'
- id: auth
- name: Authenticate with GCP service account
if: steps.changes.outputs.lock == 'true'
uses: google-github-actions/auth@v1
with:
Expand Down
4 changes: 4 additions & 0 deletions web-client/Dockerfile.base-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM rust:1.73-slim-buster as base-builder
RUN rustup target add wasm32-unknown-unknown
RUN cargo install trunk
# Upload this image as track-client-base-builder
8 changes: 3 additions & 5 deletions web-client/Dockerfile.builder
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
FROM rust:1.73-slim-buster as builder
RUN rustup target add wasm32-unknown-unknown
RUN cargo install trunk
# The base builder will have trunk installed
FROM us-central1-docker.pkg.dev/hubs-dev-333333/ocho-osai/johnshaughnessy/track/track-client-base-builder as builder
COPY . .
WORKDIR /track
RUN trunk build web-client/index.html # Build once so that dependencies are cached
RUN rm -rf web-client/dist # The built files are not needed in the final image

# Changes to this file will cause the workflow to rebuild the builder image
# Rebuild=1
# Upload this image as track-client-builder

0 comments on commit a46d894

Please sign in to comment.