napi-rs/.github/workflows/docker.yaml

87 lines
2.8 KiB
YAML
Raw Normal View History

name: Docker nightly build
on:
schedule:
2022-10-24 13:08:58 +09:00
- cron: '0 0 1 * *'
workflow_dispatch:
jobs:
build_image:
2021-09-28 14:11:28 +09:00
name: Build nodejs-rust:lts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2021-03-31 15:32:53 +09:00
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
2021-03-31 15:32:53 +09:00
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
2021-03-31 15:47:13 +09:00
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
2021-03-31 15:32:53 +09:00
with:
2021-03-31 15:47:13 +09:00
registry: ghcr.io
2021-04-11 15:09:45 +09:00
username: ${{ secrets.GH_CONTAINER_UNAME }}
2021-04-08 11:48:41 +09:00
password: ${{ secrets.GH_TOKEN }}
2021-03-31 15:32:53 +09:00
2021-04-12 12:00:04 +09:00
- name: Build and push alpine
uses: docker/build-push-action@v5
2021-03-31 15:32:53 +09:00
with:
file: alpine.Dockerfile
2023-09-18 09:29:15 +09:00
platforms: linux/amd64,linux/arm64
2021-03-31 15:32:53 +09:00
push: true
2022-09-09 19:54:23 +09:00
tags: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
2021-04-12 12:00:04 +09:00
- name: Build and push debian
uses: docker/build-push-action@v5
2021-04-12 12:00:04 +09:00
with:
file: debian.Dockerfile
2023-09-18 09:29:15 +09:00
platforms: linux/amd64,linux/arm64
2021-04-12 12:00:04 +09:00
push: true
2022-09-09 19:54:23 +09:00
tags: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
2021-10-20 01:54:31 +09:00
- name: Install latest libc++-dev for cross build
uses: addnab/docker-run-action@v3
with:
image: node:lts-slim
options: '--platform linux/arm64 --user 0:0 -e GITHUB_TOKEN -v ${{ github.workspace }}/lib/llvm-15:/usr/lib/llvm-15'
run: >-
apt-get update &&
apt-get install -y wget gnupg2 &&
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - &&
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" >> /etc/apt/sources.list &&
echo "deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" >> /etc/apt/sources.list &&
apt-get update &&
apt-get install libc++-15-dev libc++abi-15-dev -y --fix-missing --no-install-recommends &&
rm /usr/lib/llvm-15/lib/libc++abi.so
- name: Build and push debian aarch64 cross
uses: docker/build-push-action@v5
with:
file: debian-aarch64.Dockerfile
2023-09-18 09:29:15 +09:00
platforms: linux/amd64,linux/arm64
push: true
2022-09-09 19:54:23 +09:00
tags: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
2023-03-12 18:50:38 +09:00
context: .
- name: Cleanup
2023-03-12 19:24:48 +09:00
run: sudo rm -rf "${{ github.workspace }}/lib"
2022-01-06 15:54:56 +09:00
- name: Build and push debian with zig
uses: docker/build-push-action@v5
2022-01-06 15:54:56 +09:00
with:
file: debian-zig.Dockerfile
2023-09-18 09:29:15 +09:00
platforms: linux/amd64,linux/arm64
2022-01-06 15:54:56 +09:00
push: true
2022-09-09 19:54:23 +09:00
tags: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-zig
2022-01-06 15:54:56 +09:00
2022-01-18 14:41:44 +09:00
- name: Build and push alpine with zig
uses: docker/build-push-action@v5
2022-01-18 14:41:44 +09:00
with:
file: alpine-zig.Dockerfile
2023-09-18 09:29:15 +09:00
platforms: linux/amd64,linux/arm64
2022-01-18 14:41:44 +09:00
push: true
2022-09-09 19:54:23 +09:00
tags: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine-zig