zsazsbazs2024/.github/workflows/release.yml
Balazs Toldi 64343c71f8
All checks were successful
Pack and Release / packwizInstall (push) Successful in 35s
Pack and Release / deploy (push) Successful in 25s
Switch to run_number
Signed-off-by: Balazs Toldi <balazs@toldi.eu>
2024-12-18 15:24:31 +01:00

54 lines
1.9 KiB
YAML

name: Pack and Release
on: push
jobs:
packwizInstall:
runs-on: ubuntu-latest
container:
image: bazsalanszky/packwiz-installer
steps:
- name: Install Node
run: apk add nodejs git
- name: Checkout code
uses: actions/checkout@v4
- name: Run packwiz installer
run: java -jar /packwiz-installer-bootstrap.jar -g "file://$PWD/pack.toml" || exit 1
- name: Upload mods Artifact
if: success()
uses: actions/upload-artifact@v3
with:
name: mods
path: mods/*.jar
deploy:
needs: packwizInstall
runs-on: ubuntu-latest
container:
image: alpine
steps:
- name: Install Dependencies
run: apk add nodejs git kubectl curl bash openssl
- name: Download mods Artifact
uses: actions/download-artifact@v3
with:
name: mods
- name: Set up Kubectl
uses: actions/k8s-set-context@v1
with:
kubeconfig: ${{ secrets.KUBECONFIG }}
- name: Set up Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Add Repo
run: |
helm repo add minecraft-server-charts https://itzg.github.io/minecraft-server-charts/
helm repo update
- name: Get values
run: |
helm ls -n ${{vars.NAMESPACE}} || echo "No release found"
helm get values -n ${{vars.NAMESPACE}} ${{vars.HELM_RELEASE_NAME}} > values.yaml|| echo "No values found"
- name: Upgrade Helm
run: |
helm upgrade --debug ${{vars.HELM_RELEASE_NAME}} minecraft-server-charts/minecraft -n ${{vars.NAMESPACE}} -f values.yaml --set minecraftServer.downloadModpackUrl=https://git.modus.toldi.eu/${{github.repository}}/actions/runs/${{github.run_number}}/artifacts/mods