use nix to build image for chart publish #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish chart | |
on: | |
push: | |
branches: | |
- "**" | |
tags: | |
- "*.*.*" | |
workflow_dispatch: | |
jobs: | |
publish-chart: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- uses: azure/setup-helm@v3 | |
with: | |
token: ${{secrets.GITHUB_TOKEN }} | |
- name: install dependencies | |
run: pip install chartpress | |
- uses: cachix/install-nix-action@v22 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Flake check | |
run: nix flake check | |
- name: Publish images | |
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: | | |
export TAG=$(echo ${GITHUB_REF} |cut -d/ -f3) | |
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:${TAG} | |
echo ${DOCKER_PASSWORD}|docker login -u ${DOCKER_USERNAME} --password-stdin | |
docker push renku/csi-rclone:latest | |
docker push renku/csi-rclone:${TAG} | |
- name: Publish chart | |
run: | | |
cd deploy | |
git config --global user.email "[email protected]" | |
git config --global user.name "Renku Bot" | |
export TAG=$(echo ${GITHUB_REF} |cut -d/ -f3) | |
helm dep update csi-rclone | |
chartpress --tag $TAG | |
helm lint csi-rclone | |
chartpress --tag $TAG --no-build --publish-chart | |