Skip to content

Commit

Permalink
use nix to build image for chart publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Grubenmann committed Jan 3, 2024
1 parent 2ae1d2f commit fb52043
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 59 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/build_images.yml

This file was deleted.

28 changes: 23 additions & 5 deletions .github/workflows/publish-chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Publish chart
on:
push:
branches:
- "**"
tags:
- "v*.*.*"
- "*.*.*"
workflow_dispatch:
jobs:
publish-chart:
Expand All @@ -17,19 +19,35 @@ jobs:
token: ${{secrets.GITHUB_TOKEN }}
- name: install dependencies
run: pip install chartpress
- name: Publish chart and images
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Flake check
run: nix flake check
- name: Run tests
uses: workflow/[email protected]
env:
DOCKER_USERNAME: ${{ secrets.RENKU_DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.RENKU_DOCKER_PASSWORD }}
with:
flakes-from-devshell: true
flakes: .#csi-rclone-container-layerd
script: |
nix build .#csi-rclone-container-layerd && ./result | docker load
docker tag csi-rclone:latest renku/csi-rclone:latest
docker tag csi-rclone:latest renku/csi-rclone:${echo ${GITHUB_REF} |cut -d/ -f3}
echo ${DOCKER_PASSWORD}|docker login -u ${DOCKER_USERNAME} --password-stdin
docker push renku/csi-rclone:latest
docker push renku/csi-rclone:${echo ${GITHUB_REF} |cut -d/ -f3}
- name: Publish chart and images
run: |
cd deploy
git config --global user.email "[email protected]"
git config --global user.name "Renku Bot"
echo ${DOCKER_PASSWORD}|docker login -u ${DOCKER_USERNAME} --password-stdin
export TAG=${echo ${GITHUB_REF} |cut -d/ -f3}
helm dep update csi-rclone
chartpress --tag $TAG
helm lint csi-rclone
chartpress --tag $TAG --push --publish-chart
chartpress --tag latest --push
chartpress --tag $TAG --no-build --publish-chart
2 changes: 1 addition & 1 deletion devenv/nix/containerImage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ pkgs.dockerTools.streamLayeredImage {
mkdir -p ./plugin
mkdir -p ./tmp
'';
}
}

0 comments on commit fb52043

Please sign in to comment.