From e97c8a8393dd871ce7b9081e443cb7f6a66e0650 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Thu, 21 Nov 2024 13:23:19 +0300 Subject: [PATCH] actions for go --- .github/workflows/artifact-go.yml | 32 +++++++++++++++++++++++++++++++ .github/workflows/lint-go.yml | 29 ++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/artifact-go.yml create mode 100644 .github/workflows/lint-go.yml diff --git a/.github/workflows/artifact-go.yml b/.github/workflows/artifact-go.yml new file mode 100644 index 00000000..68c54fd9 --- /dev/null +++ b/.github/workflows/artifact-go.yml @@ -0,0 +1,32 @@ +name: Artifact Golang + +on: + workflow_dispatch: + push: + branches: [master] + paths: ['web/documentserver-example/go/**'] + pull_request: + branches: [master] + paths: ['web/documentserver-example/go/**'] + +jobs: + artifact: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Build Artifact + run: | + cd ${{ github.workspace }} + cwd=$(pwd) + git submodule update --init --recursive + cd ./web/documentserver-example/go + mkdir -p ./deploy/'Go Example' + rsync -av --exclude='deploy' ./ ./deploy/'Go Example' + rm -rf ./deploy/'Go Example'/static/assets/document-formats/.git + rm -rf ./deploy/'Go Example'/static/assets/document-templates/.git + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: Go.Example + path: ${{ github.workspace }}/web/documentserver-example/go/deploy \ No newline at end of file diff --git a/.github/workflows/lint-go.yml b/.github/workflows/lint-go.yml new file mode 100644 index 00000000..087a4f3b --- /dev/null +++ b/.github/workflows/lint-go.yml @@ -0,0 +1,29 @@ +name: Golangci + +on: + workflow_dispatch: + push: + branches: [master, main] + paths: ['web/documentserver-example/go/**'] + pull_request: + branches: [master, main, develop] + paths: ['web/documentserver-example/go/**'] + +jobs: + lint: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./web/documentserver-example/go + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Lint Golangci + run: | + go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + golangci-lint run \ No newline at end of file