Skip to content

Commit

Permalink
CI: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclinder committed Oct 29, 2023
1 parent 607e80e commit ca6f14c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/build-image-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,26 @@ on:
permissions: write-all

jobs:
get_ref:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.get_ref.outputs.tag }}
steps:
- name: Get Ref
id: get_ref
run: |
if ${{ github.event_name != 'push' }} ; then
echo "unexpected event: ${{ github.event_name }} "
exit 1
fi
echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
call-build-release:
needs: [get_ref]
uses: ./.github/workflows/call-image-build.yaml
with:
ref: ${{ github.ref }}
tag: ${{ github.ref }}
tag: ${{ needs.get_ref.outputs.tag }}
push: true
secrets: inherit

13 changes: 9 additions & 4 deletions .github/workflows/call-release-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
description: 'tag, sha, branch'
required: true
default: v1.0.0
push:
description: 'push chart'
required: false
default: false

permissions: write-all

Expand All @@ -22,19 +26,19 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
steps:
- name: Get Original Ref
id: get_original_ref
run: |
if ${{ github.event_name == 'workflow_dispatch' }} ; then
echo "call by workflow_dispatch"
ver=${{ inputs.ref }}
echo "ref=${ver}" >> $GITHUB_OUTPUT
echo "ref=${{ inputs.ref }}" >> $GITHUB_OUTPUT
echo "push=${{ inputs.push }}" >> $GITHUB_OUTPUT
elif ${{ github.event_name == 'push' }} ; then
echo "call by push"
ver=${{ github.ref }}
echo "ref=${ver}" >> $GITHUB_OUTPUT
echo "push=true" >> $GITHUB_OUTPUT
else
echo "unexpected event: ${{ github.event_name }}"
exit 1
Expand Down Expand Up @@ -68,6 +72,7 @@ jobs:
./cr upload \
--owner "$owner" \
--git-repo "$repo" \
--skip-existing \
--release-name-template "{{ .Name }}-chart-{{ .Version }}" \
--token "${{ secrets.GITHUB_TOKEN }}"
# Update index and push to github pages
Expand All @@ -76,4 +81,4 @@ jobs:
--git-repo "$repo" \
--index-path index.yaml \
--release-name-template "{{ .Name }}-chart-{{ .Version }}" \
--push
--push ${{ steps.get_original_ref.outputs.push }}

0 comments on commit ca6f14c

Please sign in to comment.