Adding on home registry

This commit is contained in:
James Jones
2022-12-06 18:49:44 -05:00
parent cdd06f2f1b
commit c065d6f5e9
2 changed files with 17 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ on:
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
NEXUS_REGISTRY: nexus.jamjon3.sytes.net:5443
jobs: jobs:
build-and-push: build-and-push:
@@ -23,6 +24,11 @@ jobs:
container: container:
image: quay.io/podman/stable:latest image: quay.io/podman/stable:latest
options: --userns=keep-id --privileged --user root options: --userns=keep-id --privileged --user root
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
steps: steps:
# Downloads a copy of the code in your repository before running CI tests # Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code - name: Check out repository code
@@ -36,6 +42,12 @@ jobs:
login-server: ${{ env.REGISTRY }} login-server: ${{ env.REGISTRY }}
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Login
uses: azure/docker-login@v1
with:
login-server: ${{ env.NEXUS_REGISTRY }}
username: ${{ secrets.HOME_NEXUS_DOCKER_USER }}
password: ${{ secrets.HOME_NEXUS_DOCKER_PASSWORD }}
# This requires docker buildx which podman doesn't support # This requires docker buildx which podman doesn't support
# - name: Extract metadata (tags, labels) for Docker # - name: Extract metadata (tags, labels) for Docker
# id: meta # id: meta
@@ -58,10 +70,14 @@ jobs:
VERSION=$(echo "${GITHUB_REF_NAME}" | sed 's|/|-|g') VERSION=$(echo "${GITHUB_REF_NAME}" | sed 's|/|-|g')
fi fi
podman build . --file Dockerfile --tag "$REGISTRY/$IMAGE_NAME:$VERSION" podman build . --file Dockerfile --tag "$REGISTRY/$IMAGE_NAME:$VERSION"
podman tag "$REGISTRY/$IMAGE_NAME:$VERSION" "$NEXUS_REGISTRY/$IMAGE_NAME:$VERSION"
podman push "$REGISTRY/$IMAGE_NAME:$VERSION" podman push "$REGISTRY/$IMAGE_NAME:$VERSION"
podman push "$NEXUS_REGISTRY/$IMAGE_NAME:$VERSION"
if [[ "$GITHUB_REF" =~ ^refs/tags.* ]]; then if [[ "$GITHUB_REF" =~ ^refs/tags.* ]]; then
podman tag "$REGISTRY/$IMAGE_NAME:$VERSION" "$REGISTRY/$IMAGE_NAME:latest" podman tag "$REGISTRY/$IMAGE_NAME:$VERSION" "$REGISTRY/$IMAGE_NAME:latest"
podman tag "$NEXUS_REGISTRY/$IMAGE_NAME:$VERSION" "$NEXUS_REGISTRY/$IMAGE_NAME:latest"
podman push "$REGISTRY/$IMAGE_NAME:latest" podman push "$REGISTRY/$IMAGE_NAME:latest"
podman push "$NEXUS_REGISTRY/$IMAGE_NAME:latest"
fi fi
# env: # env:
# REG_TOKEN: ${{ secrets.GITHUB_TOKEN }} # REG_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -3,7 +3,7 @@ FROM quay.io/podman/stable:latest
# Adding on the docker alias, docker-compose and other useful stuff # Adding on the docker alias, docker-compose and other useful stuff
RUN dnf install -y podman-docker buildah skopeo docker-compose \ RUN dnf install -y podman-docker buildah skopeo docker-compose \
util-linux ansible-core openssh-clients krb5-devel krb5-libs krb5-workstation git jq unzip coreutils \ util-linux ansible-core openssh-clients krb5-devel krb5-libs krb5-workstation git jq unzip coreutils \
helm doctl kubernetes-client helm doctl kubernetes-client pinentry
# Adding some Ansible Key and Timeout setting # Adding some Ansible Key and Timeout setting
ENV ANSIBLE_HOST_KEY_CHECKING=False ENV ANSIBLE_HOST_KEY_CHECKING=False