Skip to content

Commit

Permalink
Merge pull request #2 from krzwiatrzyk/feat/release-only-changes
Browse files Browse the repository at this point in the history
feat(gha): release only changed charts to s3
  • Loading branch information
krzwiatrzyk authored Dec 6, 2023
2 parents c7501fd + b37b459 commit 3308b1f
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/s3-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Release charts to S3

on:
workflow_dispatch:
push:
branches:
- main
paths:
- charts/**
# push:
# branches:
# - main
# paths:
# - charts/**

permissions:
id-token: write
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/s3-template-changed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Tempalte changed charts

on:
workflow_dispatch:
push:
branches:
- main
paths:
- charts/**

permissions:
id-token: write
contents: read

jobs:
generate-matrix:
outputs:
list: ${{ steps.list.outputs.list }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
with:
dir_names: true
dir_names_exclude_current_dir: true
dir_names_max_depth: 2

- name: Show changes
id: list
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
echo ${{ steps.changed-files.outputs.all_changed_files }} | tr " " "\n" | grep charts | xargs -n 1 basename | tr "\n" " " | jq -R -s -c 'split(" ")[:-1]' > res.json
echo "list<<EOF" >> $GITHUB_OUTPUT
cat res.json >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
template:
runs-on: ubuntu-latest
needs:
- generate-matrix
strategy:
matrix:
chart: ${{ fromJson(needs.generate-matrix.outputs.list) }}
defaults:
run:
working-directory: charts/${{ matrix.chart }}
steps:
- uses: actions/checkout@v3

- name: Update dependencies
run: helm dependency update

- name: Helm template
run: helm template .
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## Github Actions

- [chart-releaser](https://github.com/helm/chart-releaser-action)
- [changed files](https://github.com/marketplace/actions/changed-files)


## Tools
Expand Down
3 changes: 2 additions & 1 deletion charts/traggo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ resources: {}
env:
TRAGGO_DEFAULT_USER_NAME: "admin"
TRAGGO_DEFAULT_USER_PASS: "mynewpassword"
TRAGGO_PORT: "3030"
TRAGGO_PORT: "3030"

3 changes: 3 additions & 0 deletions charts/user-management/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ cluster-admins: []

# Create ServiceAccount in "user" namespace
service-accounts: []



0 comments on commit 3308b1f

Please sign in to comment.