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

Push all images to GitHub Container Registry in addition to Docker Hub #62

Merged
merged 1 commit into from
Aug 29, 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
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,18 @@ jobs:
- pre-artefact-creation
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: make push

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ all: build
build: action.yml Dockerfile entrypoint scripts/*
docker build --pull -t "${IMAGE}:${IMAGE_TAG}" .
docker build --pull -t "${IMAGE}:latest" .
docker build --pull -t "ghcr.io/${IMAGE}:${IMAGE_TAG}" .
docker build --pull -t "ghcr.io/${IMAGE}:latest" .
touch $@

push: build
docker push "${IMAGE}:${IMAGE_TAG}"
docker push "${IMAGE}:latest"
docker push "ghcr.io/${IMAGE}:${IMAGE_TAG}"
docker push "ghcr.io/${IMAGE}:latest"

pylint: build $(PYTHON_COMMANDS)
$(foreach file, $(notdir $(PYTHON_COMMANDS)), \
echo "Linting $(file)"; \
docker run --entrypoint pylint --rm "${IMAGE}:latest" /commands/$(file); \
docker run --entrypoint pylint --rm "ghcr.io/${IMAGE}:latest" /commands/$(file); \
)

.PHONY: push
Loading