Skip to content

Commit

Permalink
Push images to GitHub Container Registry in addition to DockerHub
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanTAllen committed Aug 30, 2023
1 parent 29f1c1c commit 1e6858c
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 19 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/update-latest-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,26 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Login to Docker Hub
- 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: Build
run: make build-latest config=public
- name: Push
run: make push-latest config=public
- name: Build and push to DockerHub
run: |
make build-latest config=dockerhub
make push-latest config=dockerhub
- 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 to GitHub Container Registry
run: |
make build-latest config=public
make push-latest config=public
- name: Send alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@b62d5a0e48a4d984ea4fce5dd65ba691963d4db4
Expand All @@ -45,7 +56,8 @@ jobs:
- name: Checkout source
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -70,6 +82,7 @@ jobs:

prune-untagged-images:
needs:
- rebuild-public-latest-image
- rebuild-private-latest-image

name: Prune untagged images
Expand Down
46 changes: 35 additions & 11 deletions .github/workflows/update-release-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,26 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Login to Docker Hub
- 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: Build
run: make build-release config=public
- name: Push
run: make push-release config=public
- name: Build and Push to DockerHub
run: |
make build-release config=dockerhub
make push-release config=dockerhub
- 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 to GitHub Container Registry
run: |
make build-release config=public
make push-release config=public
- name: Send alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@b62d5a0e48a4d984ea4fce5dd65ba691963d4db4
Expand All @@ -45,7 +56,8 @@ jobs:
- name: Checkout source
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down Expand Up @@ -82,12 +94,23 @@ jobs:
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Build
run: make build version="${VERSION}" config=public
- name: Build and Push to DockerHub
run: |
make build version="${VERSION}" config=dockerhub
make push version="${VERSION}" config=dockerhub
env:
VERSION: ${{ github.event.client_payload.version }}
- name: Push
run: make push version="${VERSION}" config=public
- 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 to GitHub Container Registry
run: |
make build version="${VERSION}" config=public
make push version="${VERSION}" config=public
env:
VERSION: ${{ github.event.client_payload.version }}
- name: Send alert on failure
Expand All @@ -112,7 +135,8 @@ jobs:
- name: Checkout source
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
# v2.2.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
config ?= public

ifdef config
ifeq (,$(filter $(config),public private))
ifeq (,$(filter $(config),public private dockerhub))
$(error Unknown configuration "$(config)")
endif
endif

ifeq ($(config),private)
IMAGE := ghcr.io/ponylang/library-documentation-action-v2-insiders
PACKAGE = "git+https://${MATERIAL_INSIDERS_ACCESS}@github.com/squidfunk/mkdocs-material-insiders.git"
else
else ifeq ($(config),dockerhub)
IMAGE = ponylang/library-documentation-action-v2
PACKAGE = "mkdocs-material"
else
IMAGE = ghcr.io/ponylang/library-documentation-action-v2
PACKAGE = "mkdocs-material"
endif

all: pylint
Expand Down

0 comments on commit 1e6858c

Please sign in to comment.