-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(internal-dashboard): adding job for building dashboard (#278)
* adding job for building dashboard * adding checkout step * spliting into two MR's * fixing paths * Github Action: Bazel Repin * changing how the files are uploaded * updating comment * updating sha of ic-icrc1 * adding pwd * adding status print * adding sha * changing to use env variable * adding sha for calculation * increasing git fetch depth * changing to correct symbols * adding better debug print * updating to non-legacy options * converting * fixing * reenabling whole main * using files instead of variable --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
89d7dd2
commit 0abe44a
Showing
5 changed files
with
111 additions
and
3 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
.github/workflows/check-modified-files-as-step/action.yaml
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,37 @@ | ||
name: Check if a path was modified | ||
description: Reusable action for checking if a file path is modified as a step. It outputs a `changed` variable which can be referenced later. | ||
|
||
inputs: | ||
path: | ||
description: 'Path to check' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
######################################## | ||
# Check to see if files changed | ||
######################################## | ||
- name: "🔍 Check if $PATH_TO_CHECK is modified in last commit " | ||
env: | ||
PATH_TO_CHECK: ${{ inputs.path }} | ||
shell: bash | ||
run: | | ||
set -eExou pipefail | ||
echo "=============== list modified files ===============" | ||
git diff --name-only HEAD^ HEAD | ||
echo "========== check paths of modified files ==========" | ||
git diff --name-only HEAD^ HEAD > files.txt | ||
while IFS= read -r file | ||
do | ||
echo $file | ||
if [[ $file != $PATH_TO_CHECK ]]; then | ||
echo "changed=false" >> $GITHUB_ENV | ||
else | ||
echo "File $file matches $PATH_TO_CHECK" | ||
echo "changed=true" >> $GITHUB_ENV | ||
break | ||
fi | ||
done < files.txt |
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,34 @@ | ||
name: Build and push dashboard image | ||
on: | ||
push: | ||
paths: | ||
- dashboard | ||
branches: | ||
- "main" | ||
pull_request: | ||
merge_group: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "🚀 Building" | ||
run: | | ||
docker build -t ghcr.io/dfinity/dre/ic-management-frontend:$GITHUB_SHA -f dashboard/Dockerfile dashboard | ||
- name: "🔧 Login to GitHub Container Registry" | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: "📦 Push images to GitHub Container Registry" | ||
if: ${{ startsWith(github.head_ref, 'container') || startsWith(github.ref, 'refs/heads/container') || (github.ref == 'refs/heads/main') }} | ||
run: | | ||
docker push ghcr.io/dfinity/dre/ic-management-frontend:$GITHUB_SHA |
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
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
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