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:
2022-04-01 15:29:51 +09:00
- uses: actions/checkout@v3
2021-03-31 15:32:53 +09:00
- name: Setup QEMU
2023-03-12 19:24:48 +09:00
uses: docker/setup-qemu-action@v2
2021-03-31 15:32:53 +09:00
- name: Setup Docker Buildx
2023-03-12 19:24:48 +09:00
uses: docker/setup-buildx-action@v2
2021-03-31 15:47:13 +09:00
- name: Login to GitHub Container Registry
2023-03-12 19:24:48 +09:00
uses: docker/login-action@v2
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
2023-03-12 19:24:48 +09:00
uses: docker/build-push-action@v4
2021-03-31 15:32:53 +09:00
with:
file: alpine.Dockerfile
platforms: linux/amd64
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
2023-03-12 19:24:48 +09:00
uses: docker/build-push-action@v4
2021-04-12 12:00:04 +09:00
with:
file: debian.Dockerfile
platforms: linux/amd64
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
2023-03-12 19:24:48 +09:00
uses: docker/build-push-action@v4
with:
file: debian-aarch64.Dockerfile
platforms: linux/amd64
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
2023-03-12 19:24:48 +09:00
uses: docker/build-push-action@v4
2022-01-06 15:54:56 +09:00
with:
file: debian-zig.Dockerfile
platforms: linux/amd64
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
2023-03-12 19:24:48 +09:00
uses: docker/build-push-action@v4
2022-01-18 14:41:44 +09:00
with:
file: alpine-zig.Dockerfile
platforms: linux/amd64
push: true
2022-09-09 19:54:23 +09:00
tags: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine-zig