Skip to content

Commit

Permalink
feat(github):添加自动构建action
Browse files Browse the repository at this point in the history
  • Loading branch information
li1553770945 committed Nov 7, 2023
1 parent f440b78 commit c7caa12
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Deploy

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go 1.21
uses: actions/setup-go@v2
with:
go-version: 1.21

- name: Build project
run: |
chmod +x build.sh
./build.sh
working-directory: . # 替换成你的仓库路径

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: output
path: output
5 changes: 5 additions & 0 deletions buid.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
RUN_NAME="personal-page-be"
mkdir -p output/bin
go env -w GOPROXY=https://goproxy.cn
go build -o output/bin/${RUN_NAME}

0 comments on commit c7caa12

Please sign in to comment.