@@ -29,25 +29,16 @@ jobs:
2929 uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
3030 with :
3131 path : .singularity/image.sif
32- key : ${{ hashFiles('container.def', 'bin/.container-tag') }}
33-
34- - name : Get gems and node files from cache
35- id : cache-bundle-npm
36- uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
37- with :
38- path : |
39- .home/.gems
40- node_modules
41- key : ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
32+ key : ${{ hashFiles('container.def', 'bin/.container-tag') }}-${{ matrix.runner }}
4233
4334 - if : ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
4435 name : Build container
4536 run : ./bin/build_container
4637
4738 - name : Upload singularity container
4839 run : |
49- singularity registry login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} oras://docker .io
50- singularity push .singularity/image.sif oras://docker .io/riscvintl /spec-generator:${{ env.TAG }}
40+ singularity registry login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} oras://ghcr .io
41+ singularity push .singularity/image.sif oras://ghcr .io/riscv /spec-generator:${{ env.TAG }}
5142
5243 build-docker-container :
5344 env :
7667 username : ${{ secrets.DOCKERHUB_USERNAME }}
7768 password : ${{ secrets.DOCKERHUB_TOKEN }}
7869
70+ - name : Login to GHCR
71+ uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
72+ with :
73+ registry : ghcr.io
74+ username : ${{ github.actor }}
75+ password : ${{ secrets.GITHUB_TOKEN }}
76+
7977 - name : Set up Docker Buildx
8078 uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
8179
8583 with :
8684 file : ./.devcontainer/Dockerfile
8785 platforms : ${{ matrix.platform }}
88- outputs : type=image,name=riscvintl/udb,push-by-digest=true,name-canonical=true,push=true
86+ outputs : type=image,"name=docker.io/riscvintl/udb,ghcr.io/riscv/udb",push-by-digest=true,name-canonical=true,push=true
87+ tags : docker.io/riscvintl/udb,ghcr.io/riscv/udb
88+ cache-from : type=gha
89+ cache-to : type=gha,mode=max
8990
9091 - name : Export digest
9192 run : |
@@ -133,10 +134,35 @@ jobs:
133134 - name : Create manifest list and push
134135 working-directory : /tmp/digests
135136 run : |
137+ CONTAINER_NAME=$(printf 'riscvintl/udb@sha256:%s ' *)
138+ echo "CONTAINER_NAME=$CONTAINER_NAME" >> $GITHUB_ENV
136139 docker buildx imagetools create \
137140 --tag riscvintl/udb:${{ env.TAG }} \
138141 $(printf 'riscvintl/udb@sha256:%s ' *)
139142
140143 - name : Inspect image
141144 run : |
142145 docker buildx imagetools inspect riscvintl/udb:${{ env.TAG }}
146+
147+ - name : Login to GHCR
148+ uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
149+ with :
150+ registry : ghcr.io
151+ username : ${{ github.actor }}
152+ password : ${{ secrets.GITHUB_TOKEN }}
153+
154+ - name : Create manifest list and push
155+ working-directory : /tmp/digests
156+ run : |
157+ docker buildx imagetools create \
158+ --tag ghcr.io/riscv/udb:${{ env.TAG }} \
159+ $(printf 'ghcr.io/riscv/udb@sha256:%s ' *)
160+
161+ - name : Inspect image
162+ run : |
163+ docker buildx imagetools inspect ghcr.io/riscv/udb:${{ env.TAG }}
164+
165+ - name : Remove intermediate containers
166+ run : |
167+ docker image rm ${{ env.CONTAINER_NAME }}
168+
0 commit comments