mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2025-12-03 10:33:18 +00:00
up build docker
This commit is contained in:
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
@@ -103,8 +103,8 @@ jobs:
|
||||
- { platform: "amd64", goos: "linux", docker_platform: "linux/amd64" }
|
||||
- { platform: "arm64v8", goos: "linux", docker_platform: "linux/arm64" }
|
||||
steps:
|
||||
# - name: Checkout code
|
||||
# uses: actions/checkout@v4
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
@@ -120,11 +120,12 @@ jobs:
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||
path: rustdesk-api/
|
||||
path: ./
|
||||
|
||||
- name: Unzip binaries
|
||||
run: |
|
||||
tar -xzf rustdesk-api/rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz -C rustdesk-api/
|
||||
mkdir release -p
|
||||
tar -xzf rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz -C release/
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
|
||||
38
.github/workflows/docker.yml
vendored
38
.github/workflows/docker.yml
vendored
@@ -1,38 +0,0 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*' # 仅当推送标签(例如 v1.0.0)时触发
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
|
||||
|
||||
|
||||
- name: Extract version from tag
|
||||
id: vars
|
||||
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: lejianwen/rustdesk-api:latest, lejianwen/rustdesk-api:${{ env.TAG }}
|
||||
27
.github/workflows/go.yml
vendored
27
.github/workflows/go.yml
vendored
@@ -1,27 +0,0 @@
|
||||
# This workflow will build a golang project
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
|
||||
|
||||
name: Go
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.22'
|
||||
- name: mod tidy
|
||||
run: go mod tidy
|
||||
- name: Build
|
||||
run: go build -v -o release/apimain cmd/apimain.go
|
||||
|
||||
- name: Test
|
||||
run: go test -v cmd/apimain.go
|
||||
@@ -3,7 +3,7 @@ FROM golang:1.22-alpine as builder
|
||||
FROM alpine
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache tzdata
|
||||
COPY rustdesk-api/release /app/
|
||||
COPY ./release /app/
|
||||
VOLUME /app/data
|
||||
|
||||
EXPOSE 21114
|
||||
|
||||
Reference in New Issue
Block a user