commit d532217b8408726247c7b6c11718bbe2f0c63520 Author: Christoph Ellrich Date: Wed Apr 9 21:18:17 2025 +0200 initial commit change token fixed Dockerfile fixed again again should work now diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..6240a6a --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,22 @@ +name: Build and push k8s-workflow-image + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build and push Docker image + env: + REGISTRY: git.ellri.ch + IMAGE_NAME: ${{ GITEA.repository_owner }}/k8s-workflow + run: | + echo "${{ secrets.GITEATOKEN }}" | docker login $REGISTRY -u ${{ GITEA.actor }} --password-stdin + docker build -t $REGISTRY/$IMAGE_NAME:latest . + docker push $REGISTRY/$IMAGE_NAME:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b082523 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM alpine + +ARG HELM_VERSION=3.2.1 +ARG KUBECTL_VERSION=1.17.5 + +# Determine architecture +RUN case `uname -m` in \ + x86_64) ARCH=amd64 ;; \ + armv7l) ARCH=arm ;; \ + aarch64) ARCH=arm64 ;; \ + ppc64le) ARCH=ppc64le ;; \ + s390x) ARCH=s390x ;; \ + *) echo "Unsupported arch" && exit 1 ;; \ + esac && echo "ARCH=$ARCH" > /envfile + +# Install Helm and kubectl +RUN . /envfile && \ + apk add --no-cache curl ca-certificates bash && \ + curl -sL https://get.helm.sh/helm-v${HELM_VERSION}-linux-${ARCH}.tar.gz | tar -xz && \ + mv linux-${ARCH}/helm /usr/bin/helm && chmod +x /usr/bin/helm && rm -rf linux-${ARCH} && \ + curl -sLO https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl && \ + mv kubectl /usr/bin/kubectl && chmod +x /usr/bin/kubectl + +WORKDIR /apps