Skip to content

Commit 58de17d

Browse files
committed
Migrate to GitHub Registry
Signed-off-by: Rafael Sene <rafael@riscv.org>
1 parent aadc866 commit 58de17d

3 files changed

Lines changed: 29 additions & 19 deletions

File tree

.github/workflows/build.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ on:
77
- "Dockerfiles/ubuntu2204"
88
- "Dockerfiles/debian"
99

10+
permissions:
11+
contents: read
12+
packages: write
13+
1014
jobs:
1115
build-and-push-docker-image:
12-
name: Build and Push to Docker Hub
16+
name: Build and Push to GHCR
1317
runs-on: ubuntu-latest
1418
steps:
1519
- name: Checkout Code
@@ -22,12 +26,13 @@ jobs:
2226
id: buildx
2327
uses: docker/setup-buildx-action@v3
2428

25-
- name: Login to Docker Hub
29+
- name: Login to GitHub Container Registry
2630
if: github.event_name != 'pull_request'
2731
uses: docker/login-action@v3
2832
with:
29-
username: ${{ secrets.DOCKERHUB_USERNAME }}
30-
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GHTOKEN }}
3136

3237
- name: Get Current Date
3338
run: echo "NOW=$(date +'%m%d%Y')" >> "$GITHUB_ENV"
@@ -39,8 +44,8 @@ jobs:
3944
file: ./Dockerfiles/ubuntu2204
4045
platforms: linux/amd64,linux/arm64
4146
tags: |
42-
riscvintl/riscv-docs-base-container-image:${{ github.sha }}
43-
riscvintl/riscv-docs-base-container-image:latest
47+
ghcr.io/riscv/riscv-docs-base-container-image:${{ github.sha }}
48+
ghcr.io/riscv/riscv-docs-base-container-image:latest
4449
push: ${{ github.event_name != 'pull_request' }}
4550

4651
- name: Build and Push Debian Image
@@ -50,6 +55,6 @@ jobs:
5055
file: ./Dockerfiles/debian
5156
platforms: linux/amd64,linux/arm64
5257
tags: |
53-
riscvintl/riscv-docs-base-container-image:${{ github.sha }}
54-
riscvintl/riscv-docs-base-container-image:small
58+
ghcr.io/riscv/riscv-docs-base-container-image:${{ github.sha }}
59+
ghcr.io/riscv/riscv-docs-base-container-image:small
5560
push: ${{ github.event_name != 'pull_request' }}

.github/workflows/weekly_build.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
- cron: "0 0 * * 1"
77
workflow_dispatch:
88

9+
permissions:
10+
contents: write
11+
packages: write
12+
913
jobs:
1014
build-and-push-docker-image:
1115
name: Weekly Build and Release
@@ -21,12 +25,13 @@ jobs:
2125
id: buildx
2226
uses: docker/setup-buildx-action@v3
2327

24-
- name: Login to Docker Hub
28+
- name: Login to GitHub Container Registry
2529
if: github.event_name != 'pull_request'
2630
uses: docker/login-action@v3
2731
with:
28-
username: ${{ secrets.DOCKERHUB_USERNAME }}
29-
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GHTOKEN }}
3035

3136
- name: Get the current date
3237
id: current_date
@@ -39,8 +44,8 @@ jobs:
3944
file: ./Dockerfiles/ubuntu2204
4045
platforms: linux/amd64,linux/arm64
4146
tags: |
42-
riscvintl/riscv-docs-base-container-image:${{ github.sha }}
43-
riscvintl/riscv-docs-base-container-image:latest
47+
ghcr.io/riscv/riscv-docs-base-container-image:${{ github.sha }}
48+
ghcr.io/riscv/riscv-docs-base-container-image:latest
4449
push: ${{ github.event_name != 'pull_request' }}
4550
- name: Build Debian Image
4651
uses: docker/build-push-action@v6
@@ -49,8 +54,8 @@ jobs:
4954
file: ./Dockerfiles/debian
5055
platforms: linux/amd64,linux/arm64
5156
tags: |
52-
riscvintl/riscv-docs-base-container-image:${{ github.sha }}
53-
riscvintl/riscv-docs-base-container-image:small
57+
ghcr.io/riscv/riscv-docs-base-container-image:${{ github.sha }}
58+
ghcr.io/riscv/riscv-docs-base-container-image:small
5459
push: ${{ github.event_name != 'pull_request' }}
5560

5661
- name: Set short SHA

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ docker build -t riscv-docs-base-container-image -f ./Dockerfiles/ubuntu2204 .
3535

3636
### Using a pre-built container image
3737

38-
If want to save time, you can easily [pull the latest image built from Docker Hub](https://hub.docker.com/repository/docker/riscvintl/riscv-docs-base-container-image/general) and skip the image building process. This is a multi-arch image (available for x86_64 and arm - so you can run on Apple silicon for instance). Execute the following step to complete this task:
38+
If want to save time, you can easily pull the latest image built from GitHub Container Registry and skip the image building process. This is a multi-arch image (available for x86_64 and arm - so you can run on Apple silicon for instance). Execute the following step to complete this task:
3939

4040
> NOTE: this step assumes you already have Docker installed and configured.
4141
4242
```bash
43-
docker pull docker.io/riscvintl/riscv-docs-base-container-image:latest
43+
docker pull ghcr.io/ghcr.io/riscv/riscv-docs-base-container-image:latest
4444
```
4545

4646
### Building the Documentation within the container directly
@@ -51,7 +51,7 @@ To build the documentation, execute the following steps:
5151
5252
```bash
5353
# run the build within the container from within the riscv-isa-manual directory
54-
docker run -it -v $(pwd)/riscv-isa-manual:/build riscvintl/riscv-docs-base-container-image:latest /bin/sh -c 'EXPORT LANG=C.utf8; cd ./build; make'
54+
docker run -it -v $(pwd)/riscv-isa-manual:/build ghcr.io/riscv/riscv-docs-base-container-image:latest /bin/sh -c 'EXPORT LANG=C.utf8; cd ./build; make'
5555
```
5656

5757
The build artifacts will be located within the `riscv-isa-manual` in the `build` directory, for instance:
@@ -98,7 +98,7 @@ To build the documentation, execute the following steps:
9898
# clone the upstream repository of the documentation (see The Branches)
9999

100100
# run the container from within the riscv-isa-manual directory
101-
docker run -it -v $(pwd)/riscv-isa-manual:/build riscvintl/riscv-docs-base-container-image:latest /bin/bash
101+
docker run -it -v $(pwd)/riscv-isa-manual:/build ghcr.io/riscv/riscv-docs-base-container-image:latest /bin/bash
102102

103103
# within the container
104104
# asciidoctor-epub3's dependency SASS fails to parse SCSS files due to the encoding being set to ANSI_X3.4-1968

0 commit comments

Comments
 (0)