diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 3531f88..6ac995b 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -18,4 +18,4 @@ jobs: - name: Authenticate with registry run: podman login -u srv_container-registry -p ${{ secrets.REGISTRY_TOKEN }} ${{ env.CONTAINER_ADDRESS }} - name: Push image - run: podman push container-registry:0 ${{ env.CONTAINER_ADDRESS }}/container-registry:0 + run: podman push container-registry:0 ${{ env.CONTAINER_ADDRESS }}/container-registry:${{ env.GITHUB_REF_NAME }} diff --git a/start.sh b/start.sh index 2d89128..0ab0f5f 100755 --- a/start.sh +++ b/start.sh @@ -5,6 +5,7 @@ image_name=$service_name image_version=0 auth_volume="$service_name"_auth +data_volume="$service_name"_data podman volume exists "$auth_volume" @@ -17,6 +18,16 @@ else echo "Created volume $auth_volume and seeded with empty htpasswd." fi +podman volume exists "$data_volume" + +if [[ "$?" != "1" ]]; then + echo "Volume $data_volume already exists." +else + podman volume create "$data_volume" + htpasswd_parent=$(podman volume inspect "$data_volume" | jq '.[0].Mountpoint' -r) + echo "Created volume $data_volume." +fi + podman pod create \ --name "$service_name" \ --replace \ @@ -27,4 +38,5 @@ podman run \ --pod "$service_name" \ --name "$service_name"_app \ -v "$auth_volume":/auth:ro \ + -v "$data_volume":/var/lib/registry \ "$image_name:$image_version"