-
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 #11 from near-daos/develop
Pulling up github actions update to release branch
- Loading branch information
Showing
2 changed files
with
18 additions
and
66 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 |
---|---|---|
|
@@ -5,9 +5,6 @@ on: | |
environment: | ||
required: false | ||
description: Specify environment to run on. Valid values are develop, production | ||
apps: | ||
required: false | ||
default: aggregator api | ||
push: | ||
branches: | ||
- develop | ||
|
@@ -21,61 +18,6 @@ env: | |
AWS_ECR_URL: ${{ secrets.AWS_ECR_URL }} | ||
|
||
jobs: | ||
get-updated-apps: | ||
name: Get Updated Apps | ||
runs-on: ubuntu-latest | ||
outputs: | ||
updated-apps: ${{ steps.updated-apps.outputs.apps }} | ||
aggregator: ${{ steps.updated-apps.outputs.aggregator }} | ||
api: ${{ steps.updated-apps.outputs.api }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
- uses: tj-actions/[email protected] | ||
id: changed-files | ||
|
||
- id: updated-apps | ||
shell: bash | ||
run: | | ||
if [[ "${{ github.event.inputs.apps }}" != "" ]] | ||
then | ||
echo "List of apps was provided manually: ${{ github.event.inputs.apps }}" | ||
echo "::set-output name=apps::${{ github.event.inputs.apps }}" | ||
for app in ${{ github.event.inputs.apps }} | ||
do | ||
echo "::set-output name=$app::true" | ||
done | ||
exit 0 | ||
fi | ||
for file in ${{ join(steps.changed-files.outputs.modified_files, ' ') }} | ||
do | ||
echo "$file was updated, checking if it is libs file" | ||
if [[ "$file" =~ ^libs/.* ]] | ||
then | ||
echo "$file matched libs" | ||
echo "::set-output name=apps::aggregator api" | ||
echo "::set-output name=aggregator::true" | ||
echo "::set-output name=api::true" | ||
exit 0 | ||
fi | ||
done | ||
for app in aggregator api | ||
do | ||
for file in ${{ join(steps.changed-files.outputs.modified_files, ' ') }} | ||
do | ||
echo "$file was updated, checking if it is $app file" | ||
if [[ "$file" =~ ^apps/$app/.* ]] | ||
then | ||
echo "$file is part of $app" | ||
export UPDATED_APPS="$UPDATED_APPS $app" | ||
echo "::set-output name=$app::true" | ||
break | ||
fi | ||
done | ||
done | ||
echo "::set-output name=apps::$UPDATED_APPS" | ||
get-environment: | ||
name: Get Environment | ||
runs-on: ubuntu-latest | ||
|
@@ -117,12 +59,10 @@ jobs: | |
build-image-aggregator: | ||
name: Build Image Aggregator | ||
if: needs.get-updated-apps.outputs.aggregator | ||
env: | ||
APP_NAME: aggregator | ||
runs-on: ubuntu-latest | ||
needs: | ||
- get-updated-apps | ||
- get-environment | ||
environment: | ||
name: ${{ needs.get-environment.outputs.environment }} | ||
|
@@ -138,12 +78,10 @@ jobs: | |
|
||
build-image-api: | ||
name: Build Image API | ||
if: needs.get-updated-apps.outputs.api | ||
env: | ||
APP_NAME: api | ||
runs-on: ubuntu-latest | ||
needs: | ||
- get-updated-apps | ||
- get-environment | ||
environment: | ||
name: ${{ needs.get-environment.outputs.environment }} | ||
|
@@ -162,7 +100,6 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: always() | ||
needs: | ||
- get-updated-apps | ||
- get-environment | ||
- build-image-aggregator | ||
- build-image-api | ||
|
@@ -182,7 +119,7 @@ jobs: | |
with: | ||
command: | | ||
set -x | ||
for APP_NAME in ${{ needs.get-updated-apps.outputs.updated-apps }} | ||
for APP_NAME in aggregator api | ||
do | ||
export CHART_FOLDER=apps/${APP_NAME}/deployment/app-chart | ||
helm lint $CHART_FOLDER | ||
|
@@ -198,7 +135,6 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: always() | ||
needs: | ||
- get-updated-apps | ||
- get-environment | ||
- build-image-aggregator | ||
- build-image-api | ||
|
@@ -218,7 +154,7 @@ jobs: | |
with: | ||
command: | | ||
set -x | ||
for APP_NAME in ${{ needs.get-updated-apps.outputs.updated-apps }} | ||
for APP_NAME in aggregator api | ||
do | ||
export CHART_FOLDER=apps/${APP_NAME}/deployment/app-chart | ||
helm lint $CHART_FOLDER | ||
|
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