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 b42eed8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 8 deletions.
41 changes: 39 additions & 2 deletions .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 @@ -21,8 +57,9 @@ jobs:
lock:
- 'web-client/Cargo.lock'
- 'web-client/Dockerfile.builder'
- 'web-client/Dockerfile.base-builder'
- id: auth
- name: Authenticate with GCP service account
if: steps.changes.outputs.lock == 'true'
uses: google-github-actions/auth@v1
with:
Expand Down Expand Up @@ -77,4 +114,4 @@ jobs:
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web-client-${{ env.SHORT_SHA }}.tar.gz"
destination: "gs://ocho-osai/track/web-client-builds/web-client-${{ env.SHORT_SHA }}.tar.gz"
destination: "ocho-osai/track/web-client-builds/"
5 changes: 5 additions & 0 deletions web-client/Dockerfile.base-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
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
# rebuild=2
12 changes: 6 additions & 6 deletions web-client/Dockerfile.builder
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM rust:1.73-slim-buster as builder
RUN rustup target add wasm32-unknown-unknown
RUN cargo install trunk
COPY . .
# 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
WORKDIR /track
COPY . .
RUN ls -la
RUN ls -la web-client/
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 b42eed8

Please sign in to comment.