Skip to content

Commit

Permalink
Merge pull request #103 from cybozu-go/migrate-to-ghcr
Browse files Browse the repository at this point in the history
Migrate to ghcr.io
  • Loading branch information
yokaze authored Jan 24, 2024
2 parents 97c3f1e + 5921627 commit c853870
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:

- name: Build setup-hw image
run: |
docker build -t quay.io/cybozu/setup-hw:latest --target stage1 docker
docker build -t quay.io/cybozu/setup-hw-secret:latest docker
docker build -t ghcr.io/cybozu-go/setup-hw:latest --target stage1 docker
docker build -t ghcr.io/cybozu-go/setup-hw-secret:latest docker
18 changes: 12 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,24 @@ jobs:

- name: Build setup-hw image
run: |
docker build -t quay.io/cybozu/setup-hw:latest --target stage1 docker
docker build -t quay.io/cybozu/setup-hw-secret:latest docker
docker build -t ghcr.io/cybozu-go/setup-hw:latest --target stage1 docker
docker build -t ghcr.io/cybozu-go/setup-hw-secret:latest docker
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push images
run: |
echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USER }} --password-stdin quay.io
tag=${GITHUB_REF#refs/tags/v}
for name in setup-hw setup-hw-secret; do
echo "pushing ${name}:v${tag} ..."
docker tag quay.io/cybozu/${name}:latest quay.io/cybozu/${name}:$tag
if ! echo $tag | grep -q -e '-'; then docker push quay.io/cybozu/${name}:latest; fi
docker push quay.io/cybozu/${name}:$tag
docker tag ghcr.io/cybozu-go/${name}:latest ghcr.io/cybozu-go/${name}:$tag
if ! echo $tag | grep -q -e '-'; then docker push ghcr.io/cybozu-go/${name}:latest; fi
docker push ghcr.io/cybozu-go/${name}:$tag
done
- name: Create release
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ ifdef GOBIN
else
cp $(foreach f, $(BINS_IMAGE), $(GOPATH)/bin/$(f)) ./docker/
endif
cd docker && docker build -t quay.io/cybozu/setup-hw:dev .
cd docker && docker build -t ghcr.io/cybozu-go/setup-hw:dev .

.PHONY: all generate check-generate setup test install build-image
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $ docker run -d --name=setup-hw \
Docker images
-------------

Docker images are available on [Quay.io](https://quay.io/repository/cybozu/setup-hw)
Docker images are available on [ghcr.io](https://github.com/cybozu-go/setup-hw/pkgs/container/setup-hw)

### Access `monitor-hw`

Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:22.04 as stage1
LABEL org.opencontainers.image.source="https://github.com/cybozu-go/setup-hw"

COPY setup-hw /usr/local/bin/setup-hw
COPY monitor-hw /usr/local/sbin/monitor-hw
Expand All @@ -9,6 +10,7 @@ CMD ["/usr/local/sbin/monitor-hw"]

# Install vendor tools
FROM stage1
LABEL org.opencontainers.image.source="https://github.com/cybozu-go/setup-hw"

# See https://linux.dell.com/repo/community/openmanage/
ARG OMSA_VERSION=11000
Expand Down

0 comments on commit c853870

Please sign in to comment.