Skip to content

Update deploy (#29) #124

Update deploy (#29)

Update deploy (#29) #124

Workflow file for this run

name: Create Helm Chart
on:
push:
branches: [ dev ]
workflow_dispatch:
workflow_call:
inputs:
lint-security-practices:
type: boolean
default: false
lint-helm-install-in-k0s-status:
type: boolean
default: true
permissions:
contents: write
actions: write
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}-create-helm-chart"
cancel-in-progress: true
jobs:
vars:
name: Generation vars
runs-on: ubuntu-latest
outputs:
branch_pages: ${{ steps.dynamic.outputs.branch_pages }}
status-lint-security-practices: ${{ steps.switcher.outputs.lint_security_practices }}
status-lint-helm-install-in-k0s-status: ${{ steps.switcher.outputs.lint_helm_install_in_k0s_status }}
steps:
- uses: actions/checkout@v4
- name: Switcher jobs
id: switcher
run: |
if [ -n '${{ inputs.lint-security-practices }}' ]
then
echo "lint_security_practices=${{ inputs.lint-security-practices }}" >> "$GITHUB_OUTPUT"
else
echo "lint_security_practices=false" >> "$GITHUB_OUTPUT"
fi
if [ -n '${{ inputs.lint-helm-install-in-k0s-status }}' ]
then
echo "lint_helm_install_in_k0s_status=${{ inputs.lint-helm-install-in-k0s-status }}" >> "$GITHUB_OUTPUT"
else
echo "lint_helm_install_in_k0s_status=true" >> "$GITHUB_OUTPUT"
fi
- name: Create dynamic vars
id: dynamic
run: |
echo "branch_pages=pages" >> "$GITHUB_OUTPUT"
run_test:
needs: [ vars ]
name: Run workflow - test
uses: ./.github/workflows/test.yaml
with:
lint-security-practices: ${{ needs.vars.outputs.status-lint-security-practices == 'true' }}
lint-helm-install-in-k0s-status: ${{ needs.vars.outputs.status-lint-helm-install-in-k0s-status == 'true' }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-run_manual
cancel-in-progress: true
deploy_to_pages:
needs: [ vars, run_test ]
name: Deploy helm charts to github pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v4
- name: Added repo
run: |
helm repo add text-adi https://text-adi.github.io/helm-charts/
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: charts
pages_branch: ${{ needs.vars.outputs.branch_pages }}
env:
CR_TOKEN: ${{ github.token }}
- name: Run workflow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# need use this bad use for manual run workflow in specific branch
gh workflow run deploy-pages.yaml --ref ${{ needs.vars.outputs.branch_pages }}