mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-06 15:20:22 +00:00
feat: add workflow to build docker image (#921)
* feat: add all platform to build with nix * fix: action do not work because pr confilct * feat: add workflow to build docker * chore: bump deps * feat: add workflow to build docker --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
42
.github/workflows/docker-nightly.yml
vendored
Normal file
42
.github/workflows/docker-nightly.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: 最新版docker image打包
|
||||
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
docker-builder:
|
||||
name: build docker
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@master
|
||||
- run: sudo apt-get install -y qemu-user-static
|
||||
|
||||
- name: Set up nix
|
||||
uses: cachix/install-nix-action@v27
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
extra_nix_config: |
|
||||
sandbox = true
|
||||
|
||||
- name: Speed Up nix
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
|
||||
- name: build docker
|
||||
run: |
|
||||
mkdir output/
|
||||
|
||||
# https://discourse.nixos.org/t/nix-github-actions-aarch64/11034
|
||||
nix build .#packages.aarch64-linux.docker_builder -o aarch64-linux.docker --print-out-paths --option system aarch64-linux --extra-platforms aarch64-linux
|
||||
cp $(readlink aarch64-linux.docker) ./output/aarch64-linux.docker.tar.gz
|
||||
|
||||
nix build .#packages.x86_64-linux.docker_builder -o x86_64-linux.docker --print-out-paths --option system x86_64-linux --extra-platforms x86_64-linux
|
||||
cp $(readlink x86_64-linux.docker) ./output/x86_64-linux.docker.tar.gz
|
||||
|
||||
# gomod2nix did not provide this
|
||||
# nix build .#packages.i686-linux.docker_builder -o i686-linux.docker --print-out-paths --option system i686-linux --extra-platforms i686-linux
|
||||
# cp $(readlink i686-linux.docker) ./output/i686-linux.docker.tar.gz
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@master
|
||||
if: ${{ !github.head_ref }}
|
||||
with:
|
||||
path: output/
|
||||
3
.github/workflows/gomod2nix.yml
vendored
3
.github/workflows/gomod2nix.yml
vendored
@@ -38,3 +38,6 @@ jobs:
|
||||
if: ${{ !github.head_ref }}
|
||||
continue-on-error: true
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
delete-branch: true
|
||||
branch-suffix: short-commit-hash
|
||||
|
||||
Reference in New Issue
Block a user