mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 02:45:49 +02:00
Merge pull request #42 from 0xJacky/optimized-for-github-runner-2.298.2
Optimized for GitHub runner 2.298.2
This commit is contained in:
commit
3d48407aad
1 changed files with 15 additions and 15 deletions
30
.github/workflows/build.yml
vendored
30
.github/workflows/build.yml
vendored
|
@ -33,12 +33,12 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up nodejs
|
- name: Set up nodejs
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '18.x'
|
node-version: 18.x
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
cache-dependency-path: 'frontend/yarn.lock'
|
cache-dependency-path: 'frontend/yarn.lock'
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ jobs:
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Archive frontend artifacts
|
- name: Archive frontend artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: frontend-dist
|
name: frontend-dist
|
||||||
path: frontend/dist
|
path: frontend/dist
|
||||||
|
@ -104,19 +104,19 @@ jobs:
|
||||||
GOARM: ${{ matrix.goarm }}
|
GOARM: ${{ matrix.goarm }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Get the version
|
- name: Get the version
|
||||||
id: get_version
|
id: get_version
|
||||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: ^1.19.0
|
go-version: ^1.19.0
|
||||||
|
|
||||||
- name: Set up cache
|
- name: Set up cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/go-build
|
~/.cache/go-build
|
||||||
|
@ -138,7 +138,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install musl cross compiler
|
- name: Install musl cross compiler
|
||||||
if: env.GOOS == 'linux'
|
if: env.GOOS == 'linux'
|
||||||
uses: Lesmiscore/musl-cross-compilers@v0.5
|
uses: 0xJacky/musl-cross-compilers@v0.6.5
|
||||||
id: musl
|
id: musl
|
||||||
with:
|
with:
|
||||||
target: ${{ env.ARCH_NAME }}-linux-musl${{ env.ABI }}
|
target: ${{ env.ARCH_NAME }}-linux-musl${{ env.ABI }}
|
||||||
|
@ -163,7 +163,7 @@ jobs:
|
||||||
echo "LD_FLAGS=-s -w" >> $GITHUB_ENV
|
echo "LD_FLAGS=-s -w" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Download frontend artifacts
|
- name: Download frontend artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: frontend-dist
|
name: frontend-dist
|
||||||
path: frontend/dist
|
path: frontend/dist
|
||||||
|
@ -174,7 +174,7 @@ jobs:
|
||||||
go build -ldflags "$LD_FLAGS -X 'github.com/0xJacky/Nginx-UI/server/settings.buildTime=$(date +%s)'" -o dist/nginx-ui -v main.go
|
go build -ldflags "$LD_FLAGS -X 'github.com/0xJacky/Nginx-UI/server/settings.buildTime=$(date +%s)'" -o dist/nginx-ui -v main.go
|
||||||
|
|
||||||
- name: Archive backend artifacts
|
- name: Archive backend artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.DIST }}
|
name: ${{ env.DIST }}
|
||||||
path: dist/nginx-ui
|
path: dist/nginx-ui
|
||||||
|
@ -194,11 +194,11 @@ jobs:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
if: env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
if: env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
if: env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
if: env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USER }}
|
username: ${{ secrets.DOCKERHUB_USER }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
@ -211,7 +211,7 @@ jobs:
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
if: github.event_name == 'release' && env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
if: github.event_name == 'release' && env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: ./dist
|
context: ./dist
|
||||||
file: ./dist/Dockerfile
|
file: ./dist/Dockerfile
|
||||||
|
@ -229,7 +229,7 @@ jobs:
|
||||||
|
|
||||||
- name: Build and push demo
|
- name: Build and push demo
|
||||||
if: env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
if: env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: ./dist
|
context: ./dist
|
||||||
file: ./dist/demo.Dockerfile
|
file: ./dist/demo.Dockerfile
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue