-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): Change implementation to use composite action
- Loading branch information
Ingvar Sigurðsson
committed
Feb 24, 2025
1 parent
3f0a217
commit 74c267a
Showing
2 changed files
with
46 additions
and
27 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,42 @@ | ||
name: 'Update helm-values charts' | ||
description: 'Copys the changeset in charts folder to helm-values repository' | ||
|
||
inputs: | ||
files: | ||
description: 'Comma seperated string of paths to copy' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Checkout helm-values repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: island-is/helm-values | ||
ref: main | ||
# This token needs to be updated with a PAT token from dirtybot | ||
token: ${{ secrets.GH_HELM_VALUES_PAT }} | ||
path: helm-values | ||
- name: Copy affected helm charts from island.is repository to helm-values repository | ||
shell: bash | ||
run: | | ||
# TODO: Only copy the affected files in charts folder. | ||
# Should be available through the work that Lommi is working on. | ||
IFS=$IFS, | ||
paths=() | ||
read -a paths <<< $files | ||
echo "$files\n$paths" | ||
for path in ${paths[@]}; do | ||
echo "Copying filepath: ${path}" | ||
cp island-is/"$path" helm-values/charts/ | ||
done | ||
- name: Commit and push changes to helm-values repository | ||
shell: bash | ||
run: | | ||
cd helm-values | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "CI Bot" | ||
git add . | ||
git commit -m "Updated helm charts" | ||
echo "Showing changeset\n $(git show)" |
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,8 +1,5 @@ | ||
on: | ||
push: | ||
branches: | ||
- 'feature/update-helm-values' | ||
# TODO: insert - main and - release/* | ||
push: {} | ||
defaults: | ||
run: | ||
shell: bash | ||
|
@@ -17,27 +14,7 @@ jobs: | |
with: | ||
fetch-depth: 1 | ||
path: island.is | ||
- name: Checkout helm-values repository | ||
uses: actions/checkout@v4 | ||
- name: Update helm-values repository | ||
uses: island.is/.github/actions/update-helm-values | ||
with: | ||
repository: island-is/helm-values | ||
ref: main | ||
token: ${{ secrets.GH_HELM_VALUES_PAT }} | ||
path: helm-values | ||
- name: Copy helm charts to helm-values repository | ||
run: | | ||
echo "$(ls -alh)" | ||
echo "$(ls -alh island.is/)" | ||
echo "$(ls -alh helm-values/)" | ||
cp -R island.is/charts/* helm-values/charts/ | ||
- name: Commit and push changes to helm-values repository | ||
run: | | ||
cd helm-values | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "CI Bot" | ||
git add . | ||
git commit -m "Updated helm charts" | ||
echo "Showing changeset\n $(git show)" | ||
echo "Done commiting" | ||
# git push | ||
files: 'charts/islandis-services/air-discount-scheme-backend/values.dev.yaml,charts/islandis-services/air-discount-scheme-web/values.dev.yaml' |