chore(deps): update ghcr.io/bakito/adguardhome-sync docker tag to v0.6.17 #277
Workflow file for this run
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
name: Build Helm Charts | |
on: | |
pull_request: | |
jobs: | |
create-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
charts: ${{ steps.charts.outputs.charts }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create changed charts matrix | |
id: charts | |
run: | | |
charts=$(git diff --merge-base origin/main --name-only | grep ^charts/ | cut -d/ -f2 | uniq | sort | jq -R -s -c 'split("\n")[:-1]') | |
echo "charts=${charts}" | |
echo "charts=${charts}" >> "$GITHUB_OUTPUT" | |
build-charts: | |
runs-on: ubuntu-latest | |
needs: create-matrix | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
fail-fast: false | |
matrix: | |
chart: ${{ fromJSON(needs.create-matrix.outputs.charts) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Helm | |
uses: azure/setup-helm@v4 | |
with: | |
version: v3.12.0 | |
- name: Run Helm dependency build | |
run: | | |
helm dependency build charts/${{ matrix.chart }} | |
- name: Run Helm template | |
run: | | |
helm template "${{ matrix.chart }}" charts/${{ matrix.chart }} | |
- name: Run Helm lint | |
run: | | |
helm lint charts/${{ matrix.chart }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check for chart version change | |
run: | | |
if git cat-file -e origin/main:charts/${{ matrix.chart }}/Chart.yaml >/dev/null; then | |
echo "Chart exists in main branch" | |
else | |
echo "Chart does not exist in main branch" | |
exit 0 | |
fi | |
old_version=$(git show origin/main:charts/${{ matrix.chart }}/Chart.yaml | yq eval ".version") | |
new_version=$(yq eval ".version" charts/${{ matrix.chart }}/Chart.yaml) | |
if [ "$old_version" == "$new_version" ]; then | |
echo "Chart version not changed" | |
exit 1 | |
fi | |
- name: Push chart to GHCR | |
run: | | |
version=$(yq eval ".version" charts/${{ matrix.chart }}/Chart.yaml) | |
branchName=$(echo "${{ github.head_ref }}" | tr '/' '-' | tr '.' '-') | |
echo "Pushing chart ${{ matrix.chart }} with version $version-$branchName.${GITHUB_SHA::7}" | |
helm package charts/${{ matrix.chart }} --version "$version-$branchName.${GITHUB_SHA::7}" | |
helm push "${{ matrix.chart }}-$version-$branchName.${GITHUB_SHA::7}.tgz" "oci://ghcr.io/${{ github.repository }}" | |
check-chart-results: | |
runs-on: ubuntu-latest | |
needs: [build-charts, create-matrix] | |
if: ${{ always() }} | |
steps: | |
- name: Check build chart matrix status | |
run: | | |
result="${{ needs.build-charts.result }}" | |
amount=$(echo '${{ needs.create-matrix.outputs.charts }}' | jq length) | |
if [[ $result == "failure" && $amount -gt 0 ]]; then | |
exit 1 | |
else | |
exit 0 | |
fi | |