From e2abac7dfeb65239905bbf8d56c3e70c053fd346 Mon Sep 17 00:00:00 2001 From: nxtcoder17 Date: Mon, 16 Dec 2024 15:22:26 +0530 Subject: [PATCH] ci: adds github workflow that builds container image --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0abe32d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release + +on: + workflow_dispatch: + inputs: + image_tag: + type: string + description: "image_tag" + required: true + default: "" + + push: + +permissions: + contents: read + packages: write + +jobs: + build-image: + runs-on: ubuntu-latest + name: plugin/helm-charts image + steps: + - uses: actions/checkout@v4 + + - uses: kloudlite/actions/setup-cache-go@v1 + with: + cache_key: "run-${{ matrix.platform }}-${{ matrix.arch }}" + working_directory: . + + - uses: kloudlite/actions/generate-image-tag@v1 + + - uses: kloudlite/actions/setup-nix-cachix@v1 + with: + flake_lock: "./flake.lock" + nix_develop_arguments: ".#default" + cachix_cache_name: ${{ secrets.CACHIX_CACHE_NAME }} + cachix_auth_token: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - uses: kloudlite/actions/setup-docker@v1 + with: + docker_registry: "ghcr.io" + docker_username: ${{ github.actor }} + docker_password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Binary + shell: bash + env: + IMAGE: "ghcr.io/${{ github.repository }}:$IMAGE_TAG" + run: |+ + run build image=$IMAGE