Skip to content

Commit 7887093

Browse files
Publish Docker images to GitHub Container Registry (#440)
In addition to Docker Hub, publish fabric-nodeenv Docker images to GitHub Container Registry to improve availability. Also: - Remove redundant Azure Pipelines build definitions. - Update the Ubuntu image versions used for the build. Signed-off-by: Mark S. Lewis <[email protected]>
1 parent 3c3d184 commit 7887093

8 files changed

+26
-454
lines changed

.editorconfig

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ trim_trailing_whitespace = true
2323
insert_final_newline = true
2424

2525
[*.md]
26-
trim_trailing_whitespace = false
26+
indent_size = 2
27+
28+
[*.{yaml,yml}]
2729
indent_size = 2
2830

2931
[*.{mj,cj,j,t}s]

.github/workflows/release.yaml

+17-18
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,18 @@ on:
99
- "v2.*"
1010
workflow_dispatch:
1111

12-
env:
13-
DOCKER_REGISTRY: ${{ github.repository_owner == 'hyperledger' && 'docker.io' || 'ghcr.io' }}
14-
1512
jobs:
1613
test:
1714
uses: ./.github/workflows/test.yaml
1815

1916
publishnpm:
20-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-24.04
2118
needs: test
2219
steps:
2320
- uses: actions/setup-node@v4
2421
with:
25-
node-version: '18.x'
26-
registry-url: 'https://registry.npmjs.org'
22+
node-version: "18.x"
23+
registry-url: "https://registry.npmjs.org"
2724
- uses: actions/download-artifact@v4
2825
with:
2926
name: node-tgzs
@@ -37,43 +34,45 @@ jobs:
3734
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3835
3936
publishdocker:
40-
runs-on: ubuntu-20.04
37+
runs-on: ubuntu-latest
4138
needs: test
4239
permissions:
4340
contents: read
4441
packages: write
45-
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
DOCKER_REGISTRY:
46+
- "docker.io"
47+
- "ghcr.io"
4648
steps:
4749
- name: Set up QEMU
4850
uses: docker/setup-qemu-action@v3
4951
- name: Set up Docker Buildx
5052
uses: docker/setup-buildx-action@v3
5153
with:
5254
buildkitd-flags: --debug
53-
config-inline: |
55+
buildkitd-config-inline: |
5456
[worker.oci]
5557
max-parallelism = 1
5658
- name: Checkout
5759
uses: actions/checkout@v4
58-
59-
- name: Login to the ${{ env.DOCKER_REGISTRY }} Container Registry
60+
- name: Login to the ${{ matrix.DOCKER_REGISTRY }} Container Registry
6061
uses: docker/login-action@v3
6162
with:
62-
registry: ${{ env.DOCKER_REGISTRY }}
63-
username: ${{ env.DOCKER_REGISTRY == 'docker.io' && secrets.DOCKERHUB_USERNAME || github.actor }}
64-
password: ${{ env.DOCKER_REGISTRY == 'docker.io' && secrets.DOCKERHUB_TOKEN || secrets.GITHUB_TOKEN }}
65-
63+
registry: ${{ matrix.DOCKER_REGISTRY }}
64+
username: ${{ matrix.DOCKER_REGISTRY == 'docker.io' && secrets.DOCKERHUB_USERNAME || github.actor }}
65+
password: ${{ matrix.DOCKER_REGISTRY == 'docker.io' && secrets.DOCKERHUB_TOKEN || secrets.GITHUB_TOKEN }}
6666
- name: Docker meta
6767
id: meta
6868
uses: docker/metadata-action@v5
6969
with:
70-
images: ${{ env.DOCKER_REGISTRY }}/${{ github.repository_owner }}/fabric-nodeenv
70+
images: ${{ matrix.DOCKER_REGISTRY }}/${{ github.repository_owner }}/fabric-nodeenv
7171
tags: |
7272
type=semver,pattern={{version}}
7373
type=semver,pattern={{major}}.{{minor}}
7474
type=semver,pattern={{major}}.{{minor}}.{{patch}}
75-
76-
- name: Build and push ${{ matrix.COMPONENT }} Image
75+
- name: Build and push image
7776
id: push
7877
uses: docker/build-push-action@v5
7978
with:

.github/workflows/test.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
setup:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-24.04
1212
outputs:
1313
PACKAGE_VERSION: ${{ steps.builddata.outputs.PACKAGE_VERSION }}
1414
MINOR_PACKAGE_VERSION: ${{ steps.builddata.outputs.MINOR_PACKAGE_VERSION }}
@@ -37,12 +37,12 @@ jobs:
3737
echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_OUTPUT
3838
3939
build:
40-
runs-on: ubuntu-20.04
40+
runs-on: ubuntu-24.04
4141
steps:
4242
- uses: actions/checkout@v4
4343
- uses: actions/setup-node@v4
4444
with:
45-
node-version: '18.x'
45+
node-version: "18.x"
4646
- name: Install/Rebuild/UnitTest
4747
run: |
4848
set -xev
@@ -74,13 +74,13 @@ jobs:
7474
path: fabric-nodeenv.tar.gz
7575

7676
fvtest:
77-
runs-on: ubuntu-20.04
77+
runs-on: ubuntu-24.04
7878
needs: build
7979
steps:
8080
- uses: actions/checkout@v4
8181
- uses: actions/setup-node@v4
8282
with:
83-
node-version: '18.x'
83+
node-version: "18.x"
8484
- uses: actions/download-artifact@v4
8585
with:
8686
name: nodeenv-docker-image

.github/workflows/vulnerability-scan.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
# Pulling in all the dependencies it will be able to run NPM AUDIT, and if that returns a
1515
# error code the job will fail.
1616
scan:
17-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: actions/setup-node@v4

0 commit comments

Comments
 (0)