Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
name: Build / Deploy Helm Chart
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Helm
|
|
uses: azure/setup-helm@v4.3.1
|
|
with:
|
|
version: 'latest'
|
|
|
|
- name: Update Helm chart dependencies
|
|
run: |
|
|
cd ./helm/opengist
|
|
helm dependency update
|
|
|
|
- name: Package Helm chart
|
|
run: |
|
|
cd ./helm
|
|
helm package ./opengist
|
|
|
|
# First time, create the index
|
|
wget -q https://helm.opengist.io/index.yaml
|
|
if [ ! -f index.yaml ]; then
|
|
helm repo index --url https://helm.opengist.io .
|
|
else
|
|
# For subsequent runs, merge with existing index
|
|
helm repo index --url https://helm.opengist.io --merge index.yaml .
|
|
fi
|
|
|
|
- name: Deploy to server
|
|
uses: appleboy/scp-action@master
|
|
with:
|
|
host: ${{ secrets.SERVER_HOST }}
|
|
username: ${{ secrets.SERVER_USERNAME }}
|
|
key: ${{ secrets.SERVER_SSH_KEY }}
|
|
source: "./helm/*.tgz,./helm/index.yaml"
|
|
target: ${{ secrets.HELM_SERVER_PATH }}
|
|
|
|
- name: Update remote helm repository
|
|
uses: appleboy/ssh-action@master
|
|
with:
|
|
host: ${{ secrets.SERVER_HOST }}
|
|
username: ${{ secrets.SERVER_USERNAME }}
|
|
key: ${{ secrets.SERVER_SSH_KEY }}
|
|
script: |
|
|
${{ secrets.UPDATE_HELM_REPO }} |