From 8efc619a11375355d49ca3e2a4b4717cdef497fa Mon Sep 17 00:00:00 2001 From: Daesung Park Date: Wed, 2 Oct 2024 18:46:26 +0900 Subject: [PATCH] refactor(ci): Unify GitHub Pages and Helm packaging actions (#31) --- .github/workflows/deploy.yml | 50 +++++++++++++++++++++++------ .github/workflows/package-chart.yml | 39 ---------------------- 2 files changed, 40 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/package-chart.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f5e1e69..7db1ffd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,13 +1,9 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages +name: Package and Release Helm Chart on: - # Runs on pushes targeting the default branch push: - branches: ["release/*"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + branches: + - release/* # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -22,8 +18,40 @@ concurrency: cancel-in-progress: false jobs: - # Single deploy job since we're just deploying + package: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Helm + uses: azure/setup-helm@v4.2.0 + + - name: Update Helm dependencies + run: helm dependency update ./ + + - name: Helm package + run: helm package ./ -d dist + + - name: Update Helm repo index + run: | + helm repo index ./ + + - name: Configure Git + run: | + git config --local user.name "GitHub Actions" + git config --local user.email "actions@github.com" + + - name: Commit and Push changes + run: | + git add dist/ + git add index.yaml + git commit -m "${{ github.event.head_commit.message }}" || echo "No changes to commit" + git push origin + deploy: + needs: package environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} @@ -36,8 +64,10 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - # Upload entire repository - path: '.' + path: | + dist + index.yaml + index*.html - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/.github/workflows/package-chart.yml b/.github/workflows/package-chart.yml deleted file mode 100644 index 3bc1798..0000000 --- a/.github/workflows/package-chart.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Package and Release Helm Chart - -on: - push: - branches: - - release/* - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Helm - uses: azure/setup-helm@v4.2.0 - - - name: Update Helm dependencies - run: helm dependency update ./ - - - name: Helm package - run: helm package ./ -d dist - - - name: Update Helm repo index - run: | - helm repo index ./ - - - name: Configure Git - run: | - git config --local user.name "GitHub Actions" - git config --local user.email "actions@github.com" - - - name: Commit and Push changes - run: | - git add dist/ - git add index.yaml - git commit -m "${{ github.event.head_commit.message }}" || echo "No changes to commit" - git push origin