Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put shared images in both GitHub Container Registry and DockerHub #54

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 105 additions & 8 deletions .github/workflows/linux-builder-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker login
- name: Login to DockerHub
run: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash x86-64-unknown-linux-builder/build-and-push.bash
- name: Send alert on failure
Expand All @@ -39,11 +46,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker login
- name: Login to DockerHub
run: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash x86-64-unknown-linux-builder-with-libressl-3.5.3/build-and-push.bash
- name: Send alert on failure
Expand All @@ -66,11 +80,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker login
- name: Login to DockerHub
run: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash x86-64-unknown-linux-builder-with-libressl-3.7.2/build-and-push.bash
- name: Send alert on failure
Expand All @@ -93,11 +114,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker login
- name: Login to DockerHub
run: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash x86-64-unknown-linux-builder-with-openssl_1.1.1q/build-and-push.bash
- name: Send alert on failure
Expand All @@ -120,11 +148,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker login
- name: Login to DockerHub
run: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash x86-64-unknown-linux-builder-with-openssl_1.1.1t/build-and-push.bash
- name: Send alert on failure
Expand All @@ -147,11 +182,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker login
- name: Login to DockerHub
run: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash x86-64-unknown-linux-builder-with-openssl_3.0.7/build-and-push.bash
- name: Send alert on failure
Expand All @@ -174,11 +216,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker login
- name: Login to DockerHub
run: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash x86-64-unknown-linux-builder-with-openssl_3.1.0/build-and-push.bash
- name: Send alert on failure
Expand All @@ -201,11 +250,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker login
- name: Login to DockerHub
run: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash x86-64-unknown-linux-builder-with-pcre/build-and-push.bash
- name: Send alert on failure
Expand Down Expand Up @@ -282,3 +338,44 @@ jobs:
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.

prune-untagged-builder-images:
needs:
- send-linux-builders-updated-event

name: Prune untagged builder images
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
image:
- shared-docker-ci-x86-64-unknown-linux-builder
- shared-docker-ci-x86-64-unknown-linux-builder-with-libressl-3.5.3
- shared-docker-ci-x86-64-unknown-linux-builder-with-libressl-3.7.2
- shared-docker-ci-x86-64-unknown-linux-builder-with-openssl_1.1.1q
- shared-docker-ci-x86-64-unknown-linux-builder-with-openssl_1.1.1t
- shared-docker-ci-x86-64-unknown-linux-builder-with-openssl_3.0.7
- shared-docker-ci-x86-64-unknown-linux-builder-with-openssl_3.1.0
- shared-docker-ci-x86-64-unknown-linux-builder-with-pcre

steps:
- name: Prune
# v4.1.1
uses: actions/delete-package-versions@0d39a63126868f5eefaa47169615edd3c0f61e20
with:
package-name: ${{ matrix.image }}
package-type: 'container'
min-versions-to-keep: 1
delete-only-untagged-versions: 'true'
- name: Send alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@b62d5a0e48a4d984ea4fce5dd65ba691963d4db4
with:
api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }}
email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }}
organization-url: 'https://ponylang.zulipchat.com/'
to: notifications
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.
36 changes: 35 additions & 1 deletion .github/workflows/release-a-library-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker login
- name: Login to DockerHub
run: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash release-a-library/build-and-push.bash
- name: Send alert on failure
Expand All @@ -31,3 +38,30 @@ jobs:
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.

prune-untagged-images:
needs:
- release-a-library

name: Prune untagged images
runs-on: ubuntu-latest
steps:
- name: Prune
# v4.1.1
uses: actions/delete-package-versions@0d39a63126868f5eefaa47169615edd3c0f61e20
with:
package-name: 'shared-docker-ci-release-a-library'
package-type: 'container'
min-versions-to-keep: 1
delete-only-untagged-versions: 'true'
- name: Send alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@b62d5a0e48a4d984ea4fce5dd65ba691963d4db4
with:
api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }}
email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }}
organization-url: 'https://ponylang.zulipchat.com/'
to: notifications
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.
9 changes: 8 additions & 1 deletion actionlint/build-and-push.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ set -o errexit
set -o nounset

#
# *** You should already be logged in to DockerHub when you run this ***
# *** You should already be logged in to DockerHub
# and GitHub Container Registry when you run this ***
#

NAME="ponylang/shared-docker-ci-actionlint"
TODAY=$(date +%Y%m%d)
DOCKERFILE_DIR="$(dirname "$0")"

# DockerHub
docker build --pull -t "${NAME}:${TODAY}" "${DOCKERFILE_DIR}"
docker push "${NAME}:${TODAY}"

# GitHub Container Registry
NAME="ghcr.io/${NAME}"
docker build --pull -t "${NAME}:${TODAY}" "${DOCKERFILE_DIR}"
docker push "${NAME}:${TODAY}"
33 changes: 28 additions & 5 deletions release-a-library/build-and-push.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,46 @@ set -o errexit
set -o nounset

#
# *** You should already be logged in to DockerHub when you run this ***
# *** You should already be logged in to DockerHub
# and GitHub Container Registry when you run this ***
#

DOCKERFILE_DIR="$(dirname "$0")"

## DockerHub

# built from ponyc release tag
NAME="ponylang/shared-docker-ci-release-a-library"
FROM_TAG=release-alpine
TAG_AS=release
docker build --pull --build-arg FROM_TAG="${FROM_TAG}" \
-t "${NAME}:${TAG_AS}" \
"${DOCKERFILE_DIR}"
docker push "${NAME}:${TAG_AS}"

# built from ponyc latest tag
FROM_TAG=alpine
TAG_AS=latest
docker build --pull --build-arg FROM_TAG="${FROM_TAG}" \
-t "${NAME}:${TAG_AS}" \
"${DOCKERFILE_DIR}"
docker push "${NAME}:${TAG_AS}"

## GitHub Container Registry

# built from ponyc release tag
NAME="ghcr.io/ponylang/shared-docker-ci-release-a-library"
FROM_TAG=release-alpine
TAG_AS=release
docker build --pull --build-arg FROM_TAG="${FROM_TAG}" \
-t ponylang/shared-docker-ci-release-a-library:"${TAG_AS}" \
-t "${NAME}:${TAG_AS}" \
"${DOCKERFILE_DIR}"
docker push ponylang/shared-docker-ci-release-a-library:"${TAG_AS}"
docker push "${NAME}:${TAG_AS}"

# built from ponyc latest tag
FROM_TAG=alpine
TAG_AS=latest
docker build --pull --build-arg FROM_TAG="${FROM_TAG}" \
-t ponylang/shared-docker-ci-release-a-library:"${TAG_AS}" \
-t "${NAME}:${TAG_AS}" \
"${DOCKERFILE_DIR}"
docker push ponylang/shared-docker-ci-release-a-library:"${TAG_AS}"
docker push "${NAME}:${TAG_AS}"
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,44 @@ set -o errexit
set -o nounset

#
# *** You should already be logged in to DockerHub when you run this ***
# *** You should already be logged in to DockerHub
# and GitHub Container Registry when you run this ***
#

DOCKERFILE_DIR="$(dirname "$0")"
IMAGE="ponylang/shared-docker-ci-x86-64-unknown-linux-builder-with-libressl-3.5.3"

## DockerHub

NAME="ponylang/shared-docker-ci-x86-64-unknown-linux-builder-with-libressl-3.5.3"

# built from x86-64-unknown-linux-builder release tag
FROM_TAG=release
TAG_AS=release
docker build --pull --build-arg FROM_TAG="${FROM_TAG}" \
-t "${NAME}:${TAG_AS}" "${DOCKERFILE_DIR}"
docker push "${NAME}:${TAG_AS}"

# built from x86-64-unknown-linux-builder latest tag
FROM_TAG=latest
TAG_AS=latest
docker build --pull --build-arg FROM_TAG="${FROM_TAG}" \
-t "${NAME}:${TAG_AS}" "${DOCKERFILE_DIR}"
docker push "${NAME}:${TAG_AS}"

## GitHub Container Registry

NAME="ghcr.io/ponylang/shared-docker-ci-x86-64-unknown-linux-builder-with-libressl-3.5.3"

# built from x86-64-unknown-linux-builder release tag
FROM_TAG=release
TAG_AS=release
docker build --pull --build-arg FROM_TAG="${FROM_TAG}" \
-t "${IMAGE}:${TAG_AS}" "${DOCKERFILE_DIR}"
docker push "${IMAGE}:${TAG_AS}"
-t "${NAME}:${TAG_AS}" "${DOCKERFILE_DIR}"
docker push "${NAME}:${TAG_AS}"

# built from x86-64-unknown-linux-builder latest tag
FROM_TAG=latest
TAG_AS=latest
docker build --pull --build-arg FROM_TAG="${FROM_TAG}" \
-t "${IMAGE}:${TAG_AS}" "${DOCKERFILE_DIR}"
docker push "${IMAGE}:${TAG_AS}"
-t "${NAME}:${TAG_AS}" "${DOCKERFILE_DIR}"
docker push "${NAME}:${TAG_AS}"
Loading
Loading