-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1099 from jumpserver/pr@v4@perf_docker_build
perf: 优化构建
- Loading branch information
Showing
3 changed files
with
36 additions
and
14,984 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 |
---|---|---|
@@ -1,32 +1,46 @@ | ||
name: "Run Build Test" | ||
on: | ||
push: | ||
branches: | ||
- pr@* | ||
- repr@* | ||
paths: | ||
- 'Dockerfile' | ||
- 'Dockerfile*' | ||
- 'package.json' | ||
- 'yarn.lock' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
component: [luna] | ||
version: [v4] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v3 | ||
|
||
- uses: docker/setup-qemu-action@v2 | ||
- name: Prepare Build | ||
run: | | ||
sed -i '[email protected]@registry.yarnpkg.com@g' yarn.lock | ||
- uses: docker/setup-buildx-action@v2 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: docker/build-push-action@v3 | ||
- name: Build Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: false | ||
tags: jumpserver/luna:test | ||
push: true | ||
file: Dockerfile | ||
tags: ghcr.io/jumpserver/${{ matrix.component }}:${{ matrix.version }} | ||
platforms: linux/amd64 | ||
build-args: | | ||
VERSION=${{ matrix.version }} | ||
APT_MIRROR=http://deb.debian.org | ||
NPM_REGISTRY=https://registry.yarnpkg.com | ||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- uses: LouisBrunner/[email protected] | ||
if: always() | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
name: Check Build | ||
conclusion: ${{ job.status }} |
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
Oops, something went wrong.