mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 13:09:04 +08:00
修改 docker 编译
This commit is contained in:
58
.github/workflows/release.yml
vendored
58
.github/workflows/release.yml
vendored
@@ -14,33 +14,65 @@ jobs:
|
||||
TZ: Asia/Shanghai
|
||||
steps:
|
||||
- name: Hello world
|
||||
run: |
|
||||
cd server && go mod tidy
|
||||
uname -a
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20'
|
||||
cache-dependency-path: 'server/go.sum'
|
||||
run: uname -a
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: 'web/yarn.lock'
|
||||
- name: Build web
|
||||
working-directory: web
|
||||
run: |
|
||||
yarn install
|
||||
yarn run build
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20'
|
||||
cache-dependency-path: 'server/go.sum'
|
||||
- # https://github.com/docker/setup-qemu-action
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Docker Build
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: bjdgyc
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
logout: true
|
||||
|
||||
- name: pre bash
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir server/ui
|
||||
touch server/ui/index.html
|
||||
#sudo apt-get install -y -q gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
||||
bash release.sh
|
||||
appVer=`cat version`
|
||||
commitId=`git rev-parse HEAD`
|
||||
buildDate=`date --iso-8601=seconds`
|
||||
echo "APP_VER=$appVer" >> $GITHUB_ENV
|
||||
echo "commitId=$commitId" >> $GITHUB_ENV
|
||||
echo "buildDate=$buildDate" >> $GITHUB_ENV
|
||||
|
||||
cd server;go mod tidy
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: false
|
||||
context: .
|
||||
file: ./docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
build-args: appVer=$APP_VER commitId=$commitId buildDate=$buildDate
|
||||
#tags: bjdgyc/anylink:latest,bjdgyc/anylink:${{ env.APP_VER }}
|
||||
tags: bjdgyc/anylink:${{ env.APP_VER }}
|
||||
|
||||
# - name: Docker Build binary
|
||||
# shell: bash
|
||||
# run: |
|
||||
# #sudo apt-get install -y -q gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
||||
# bash release.sh
|
||||
|
||||
# Docker:
|
||||
# name: build-docker
|
||||
|
Reference in New Issue
Block a user