-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,16 +65,17 @@ jobs: | |
steps: | ||
- uses: actions/[email protected] | ||
- run: | | ||
source ./staticnode/node-version.sh | ||
arch=$(echo "${{ runner.arch }}" | tr '[:upper:]' '[:lower:]') | ||
echo "NODE_ARCH=$arch" >> $GITHUB_ENV | ||
echo "NODE_ARCH_RELEASE=$arch:$NODE_VERSION" >> $GITHUB_ENV | ||
# Pull the previous image, but if it fails return true anyway. | ||
# Sometimes we add new docker images and if they've never been pushed | ||
# they can't be pulled. | ||
- name: Pull existing image | ||
run: docker pull ghcr.io/pyca/${{ matrix.IMAGE.TAG_NAME }} || true | ||
if: github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' | ||
- name: Build image | ||
run: docker build --pull --cache-from ghcr.io/pyca/${{ matrix.IMAGE.TAG_NAME }} -t ghcr.io/pyca/${{ matrix.IMAGE.TAG_NAME }} ${{ matrix.IMAGE.DOCKERFILE_PATH }} ${{ matrix.IMAGE.BUILD_ARGS }} --build-arg NODE_ARCH_RELEASE=${{ env.NODE_ARCH }}:v20.13.1 | ||
run: docker build --pull --cache-from ghcr.io/pyca/${{ matrix.IMAGE.TAG_NAME }} -t ghcr.io/pyca/${{ matrix.IMAGE.TAG_NAME }} ${{ matrix.IMAGE.DOCKERFILE_PATH }} ${{ matrix.IMAGE.BUILD_ARGS }} --build-arg NODE_ARCH_RELEASE=${{ env.NODE_ARCH_RELEASE }} | ||
- name: Login to docker | ||
run: 'docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" ghcr.io' | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,22 +23,24 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
IMAGE: | ||
- {RUNNER: "ubuntu-latest", NODE_ARCH: "x64", MANYLINUX_ARCH: "x86_64"} | ||
- {RUNNER: [self-hosted, Linux, ARM64], NODE_ARCH: "arm64", MANYLINUX_ARCH: "aarch64"} | ||
- {RUNNER: "ubuntu-latest", MANYLINUX_ARCH: "x86_64"} | ||
- {RUNNER: [self-hosted, Linux, ARM64], MANYLINUX_ARCH: "aarch64"} | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set Node.js version | ||
run: | | ||
source ./staticnode/node-version.sh | ||
echo "NODE_VERSION=$NODE_VERSION" >> $GITHUB_ENV | ||
arch=$(echo "${{ runner.arch }}" | tr '[:upper:]' '[:lower:]') | ||
echo "NODE_ARCH=$arch" >> $GITHUB_ENV | ||
- name: Build the Docker image | ||
run: | | ||
echo building node.js $NODE_VERSION | ||
docker build --tag ghcr.io/pyca/static-nodejs-${{ matrix.IMAGE.NODE_ARCH }}:$NODE_VERSION --build-arg VERSION=$NODE_VERSION --build-arg ARCH=${{ matrix.IMAGE.NODE_ARCH }} staticnode | ||
docker build --tag ghcr.io/pyca/static-nodejs-$NODE_ARCH:$NODE_VERSION --build-arg VERSION=$NODE_VERSION --build-arg ARCH=$NODE_ARCH staticnode | ||
- name: Test static node.js on manylinux2014 | ||
run: | | ||
cd staticnode | ||
docker build -f Dockerfile-test -t test-node --build-arg MANYLINUX_ARCH=${{ matrix.IMAGE.MANYLINUX_ARCH }} --build-arg CONTAINER_NAME=ghcr.io/pyca/static-nodejs-${{ matrix.IMAGE.NODE_ARCH }}:$NODE_VERSION . | ||
docker build -f Dockerfile-test -t test-node --build-arg MANYLINUX_ARCH=${{ matrix.IMAGE.MANYLINUX_ARCH }} --build-arg CONTAINER_NAME=ghcr.io/pyca/static-nodejs-$NODE_ARCH:$NODE_VERSION . | ||
docker run test-node /staticnode/bin/node -e "console.log('hello world'); console.log(process.version)" | ||
- name: Login to docker | ||
run: 'docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" ghcr.io' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters