Skip to content

Commit

Permalink
ci(container): Update container image building workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
KirilMihaylov committed Aug 6, 2024
1 parent e64e32a commit 3d3d03b
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,18 @@ jobs:
- uses: "actions/checkout@v4"
- name: "Build image"
run: |-
set -e
set -ex
"docker" \
"buildx" \
"podman" \
"build" \
--tag "service" \
--build-arg "package=${package}" \
--build-arg "profile=release" \
--build-arg "profile_output_dir=release" \
--file "./Containerfile" \
--format "oci" \
--pull \
--target "${package}" \
--build-arg "package=${package}" \
--tag "service" \
--target "service" \
.
- name: "Login at container registry"
env:
Expand All @@ -125,8 +127,14 @@ jobs:
run: |
set -e
echo "${github_token}" | docker login "${container_registry}" \
--username "\$" --password-stdin
"podman" \
"login" \
"${container_registry}" \
--username "\$" \
--password-stdin \
<<EOF
${github_token}
EOF
- name: "Push image to container registry"
run: |
set -e
Expand All @@ -143,18 +151,18 @@ jobs:
regex="^[[:digit:]]\{1,\}\.[[:digit:]]\{1,\}\.[[:digit:]]\{1,\}\$"
readonly regex
if grep -q -s "${regex}" <<-EOF
if "grep" -q -s "${regex}" <<-EOF
${tag}
EOF
then
docker tag "service" "${image_url}:latest"
"podman" "tag" "service" "${image_url}:latest"
docker push "${image_url}:latest"
"podman" "push" "${image_url}:latest"
fi
for image_tag in "${tag}" "dev"
do
docker tag "service" "${image_url}:${image_tag}"
"podman" "tag" "service" "${image_url}:${image_tag}"
docker push "${image_url}:${image_tag}"
"podman" "push" "${image_url}:${image_tag}"
done

0 comments on commit 3d3d03b

Please sign in to comment.