Skip to content

Commit

Permalink
Merge pull request #38 from uw-it-aca/pm-add_build_automation
Browse files Browse the repository at this point in the history
pm add build automation
  • Loading branch information
paulkm authored Aug 16, 2024
2 parents 6554eb0 + ddac6f8 commit d4f9236
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/notebook-images-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: rttl-notebook-images-ci

on:
push:
branches:
- 'main'
env:
GAR_LOCATION: us-west1

jobs:
get-changed:
# check for any changes to a worker VERSION file
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.mapped-files.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
**/VERSION
json: true
write_output_files: true
-
name: Map to JSON
# Get the parent folder and add to an array
id: mapped-files
run: |
set -eux
DATA=$(echo ${{ steps.changed-files.outputs.all_changed_files }} | jq -c '. | map(split("/")[0]) | unique')
echo "matrix=$DATA" >> "$GITHUB_OUTPUT"
build-workers:
needs: get-changed
# Skip if no changes in worker versions in this push
if: needs.get-changed.outputs.matrix != '[]'
runs-on: ubuntu-latest
strategy:
matrix:
versions: ${{ fromJSON(needs.get-changed.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Get version number
# Read the version number out of worker_name/VERSION and push to ENV
env:
CTX: ${{ matrix.versions }}
run: |
VER=$(cat ${CTX}/VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
-
name: Docker login with GCP credentials
id: gcp-login
shell: bash
run: |
echo "${{ secrets.GCP_JSON_KEY }}" |
base64 -d |
docker login --username=_json_key --password-stdin https://${{ env.GAR_LOCATION }}-docker.pkg.dev
-
name: Build and push
# Build docker image using the app folder context.
# Tag with worker name and version string
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:${{ matrix.versions }}"
push: true
tags: |
${{ env.GAR_LOCATION }}-docker.pkg.dev/uwit-mci-axdd/rttl-images/jupyter-${{ matrix.versions }}-notebook:${{ env.VERSION }}
1 change: 1 addition & 0 deletions datascience/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci-test
1 change: 1 addition & 0 deletions r/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci-test
1 change: 1 addition & 0 deletions rstudio/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci-test
1 change: 1 addition & 0 deletions scipy/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci-test
1 change: 1 addition & 0 deletions tensorflow/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci-test

0 comments on commit d4f9236

Please sign in to comment.