Adding on github actions

This commit is contained in:
James Jones
2022-11-21 14:33:36 -05:00
parent 37a36b29c8
commit 1b452f55e2

View File

@@ -23,11 +23,12 @@ jobs:
VERSION=$(echo "${GITHUB_REF_NAME}" | sed 's|/|-|g') VERSION=$(echo "${GITHUB_REF_NAME}" | sed 's|/|-|g')
fi fi
podman build . --file Dockerfile --tag podman-dind-like:$VERSION podman build . --file Dockerfile --tag podman-dind-like:$VERSION
echo $REG_TOKEN | docker login ghcr.io -u jamjon3 --password-stdin echo $REG_TOKEN | podman login ghcr.io -u jamjon3 --password-stdin
podman push ghcr.io/jamesjonesconsulting/podman-dind-like:$VERSION podman push "ghcr.io/$IMAGE_NAME:$VERSION"
if [[ "$GITHUB_REF" =~ ^refs/tags.* ]]; then if [[ "$GITHUB_REF" =~ ^refs/tags.* ]]; then
podman tag "ghcr.io/jamesjonesconsulting/podman-dind-like:$VERSION" "ghcr.io/jamesjonesconsulting/podman-dind-like:latest" podman tag "ghcr.io/$IMAGE_NAME:$VERSION" "$IMAGE_NAME:latest"
podman push ghcr.io/jamesjonesconsulting/podman-dind-like:latest podman push "ghcr.io/$IMAGE_NAME:latest"
fi fi
env: env:
REG_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} REG_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
IMAGE_NAME: jamesjonesconsulting/podman-dind-like