From 659f4c9982de69a56737cdf21a556a8abca67a75 Mon Sep 17 00:00:00 2001 From: dsklyadnev Date: Mon, 29 Jul 2024 12:20:27 +0000 Subject: [PATCH] Add workflows/build-service.yml --- workflows/build-service.yml | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 workflows/build-service.yml diff --git a/workflows/build-service.yml b/workflows/build-service.yml new file mode 100644 index 0000000..65b3fe5 --- /dev/null +++ b/workflows/build-service.yml @@ -0,0 +1,49 @@ +on: + push: + branches: + - dev + - master + tags: + - 'v*' + +jobs: + test: + runs-on: host + steps: + - name: Checkout app + shell: bash -l {0} + uses: actions/checkout@v4 + with: + path: app + - name: Test + run: go test -v ./... + working-directory: app + - name: Checkout scripts + shell: bash -l {0} + uses: actions/checkout@v4 + with: + repository: develop/scripts + ref: master + path: scripts + token: ${{ secrets.DEPLOY_KEY }} + - run: chmod +rwx scripts/build/build.sh + - name: Build app + run: scripts/build/build.sh + env: + BRANCH: dev + BUILD_DIR: app + BUILD_TAGS: grpc + GITHOST: ${{ vars.GITHOST }} + GITHOST_LOGIN: ${{ vars.GITHOST_LOGIN }} + GITHOST_PASSWORD: ${{ secrets.GITHOST_PASSWORD }} + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.REGISTRY }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} + - run: chmod +rwx scripts/build/build-docker.sh + - name: Build & Push docker + run: scripts/build/build-docker.sh + env: + REGISTRY: ${{ vars.REGISTRY }} \ No newline at end of file