-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: richardli1598 <richardli1598@gmail.com>
- Loading branch information
richardli1598
committed
Oct 8, 2023
1 parent
2a9a6f7
commit 48ecf34
Showing
9 changed files
with
74 additions
and
1 deletion.
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,30 @@ | ||
# Copyright 2023 opennaslab | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Build bifrost steps image | ||
on: | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v39 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.ORG_DOCKERHUB_USER }} | ||
password: ${{ secrets.ORG_DOCKERHUB_PASSWORD }} | ||
|
||
- name: List all changed files | ||
run: | | ||
cache_file=$(mktemp) | ||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | ||
step_path=$(hack/build-step.sh ${file} ${cache_file}) | ||
done |
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,41 @@ | ||
#!/bin/env bash | ||
|
||
set -o errexit | ||
|
||
function usage() { | ||
echo "This script is used to parse step." | ||
echo "Usage: hack/build-step.sh $file $cache_file" | ||
echo "Example: hack/build-step.sh steps/frpc-config/Dockerfile /tmp/step-cache" | ||
} | ||
|
||
if [[ $# -ne 2 ]]; then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
change_file_path=$1 | ||
cache_file=$2 | ||
|
||
function parse_step_name() { | ||
file_path=$1 | ||
if [[ "$file_path" =~ ^steps* ]]; then | ||
step_name=$(echo $1 | cut -d '/' -f 2) | ||
echo "$step_name" | ||
else | ||
echo "" | ||
fi | ||
} | ||
|
||
step_name=$(parse_step_name $change_file_path) | ||
if [ -z "$step_name" ]; then | ||
exit 0 | ||
fi | ||
build_step=$(cat $cache_file) | ||
if [[ "$build_step" =~ "$step_name" ]]; then | ||
exit 0 | ||
fi | ||
|
||
echo "$step_name" >> $cache_file | ||
|
||
docker build -t opennaslab/$step_name:latest steps/$step_name | ||
docker push opennaslab/$step_name:latest |
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion
2
remote-step/docker-config/Dockerfile → steps/docker-config/Dockerfile
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM opennaslab/bifrosr-base:latest | ||
FROM opennaslab/bifrost-registry-base:latest | ||
|
||
WORKDIR /root | ||
|
||
|
File renamed without changes.
File renamed without changes.
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 @@ | ||
FROM opennaslab/bifrost-registry-base:latest |
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 @@ | ||
FROM opennaslab/bifrost-registry-base:latest |