56 lines
1.9 KiB
YAML
56 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: Install zip
|
|
run: |
|
|
apk update
|
|
apk add zip
|
|
- name: Pack mods.zip
|
|
run: cd mods && zip mods.zip *.jar
|
|
- name: Upload mods Artifact
|
|
if: success()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: mods
|
|
path: mods/mods.zip
|
|
deploy:
|
|
needs: packwizInstall
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ubuntu:20.04
|
|
steps:
|
|
- name: Install Dependencies
|
|
#run: apk add nodejs git kubectl curl
|
|
run: apt-get update && apt-get install -y curl git kubectl nodejs
|
|
- 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: Deploy
|
|
run: |
|
|
helm repo add minecraft-server-charts https://itzg.github.io/minecraft-server-charts/
|
|
helm repo update
|
|
helm get values -n ${{env.NAMESPACE}} ${{env.HELM_RELEASE_NAME}} > values.yaml|| echo "No values found"
|
|
helm upgrade ${{env.HELM_RELEASE_NAME}} minecraft-server-charts/minecraft -n ${{env.NAMESPACE}} -f values.yaml --set minecraftServer.downloadModpackUrl=https://git.modus.toldi.eu/${{github.repository}}/actions/runs/${{github.run_id}}/artifacts/mods
|