-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from uw-it-aca/pm-add_build_automation
pm add build automation
- Loading branch information
Showing
6 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ci-test |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ci-test |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ci-test |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ci-test |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ci-test |