Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Part 2] Re-factor publishing charts - gh-pages #39

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: gh-pages

on:
workflow_dispatch:
inputs:
project:
description: 'Repository'
required: true
ref:
description: 'Ref'
required: true
push:
branches:
- gh-pages
- test-dispatcher

jobs:
update-gh-pages:
name: Update index.yaml
if: ${{ startsWith( github.ref, 'refs/heads/gh-pages') }}
runs-on: ubuntu-20.04
steps:
- name: Update repo index
run: |
echo "${{ secrets.CLONE_KEY }}" > id_rsa && chmod 400 id_rsa
trap "rm -f id_rsa" EXIT

helm repo index .
git diff index.yaml
git add index.yaml
git -c user.name="Ljubo Nikolic" -c user.email="[email protected]" commit -qam "Updating index.yaml"
ssh-agent bash -c 'ssh-add id_rsa; git push -q origin HEAD'

update-armada-charts:
if: ${{ github.event.inputs.project == 'ljubon/armada' }}
runs-on: ubuntu-20.04
name: Publish Armada charts
steps:
- uses: actions/checkout@v2 # Checkout Charts - gh-pages
- uses: actions/checkout@v2 # Checkout Armada - Helm source code
with:
repository: ${{ github.event.inputs.project }}
ref: ${{ github.event.inputs.ref }}
path: '${{ github.event.inputs.project }}'

- name: Update version - ${{ github.event.inputs.ref }}
run: |
find . \( -name "Chart.yaml" -o -name "values.yaml" \) -exec sed -i s/LATEST/${{ github.event.inputs.ref }}/ {} +
working-directory: ./${{ github.event.inputs.project }}

- name: Build new packages and update repo index
run: |
helm package deployment/armada/ -d ../../armada/
helm package deployment/executor -d ../../armada/
helm package deployment/executor-cluster-monitoring/ -d ../../armada/
helm package deployment/lookout/ -d ../../armada/
helm package deployment/lookout-migration/ -d ../../armada/
helm package deployment/binoculars/ -d ../../armada/
helm repo index ../../
working-directory: ./${{ github.event.inputs.project }}


#TODO Change CLONE_KEY, user.name, user.email
- name: Commit & Push new charts to gh-pages
run: |
echo "${{ secrets.CLONE_KEY }}" > id_rsa && chmod 400 id_rsa
trap "rm -f id_rsa" EXIT

git remote -v
git branch

git add ./armada index.yaml
git -c user.name="Ljubo Nikolic" -c user.email="[email protected]" commit -qam "Pushing new helm charts at version ${{ github.event.inputs.ref }}"
ssh-agent bash -c 'ssh-add id_rsa; git push -q origin HEAD'
20 changes: 0 additions & 20 deletions .github/workflows/main.yml

This file was deleted.

Loading