-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
835ba26
commit 180f756
Showing
4 changed files
with
91 additions
and
43 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 |
---|---|---|
@@ -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/ |
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
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
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