From 7a5321e603c6ec02d53170dc9cc23ad3697d5559 Mon Sep 17 00:00:00 2001 From: "dmitry.kirdyashkin" Date: Mon, 10 Jul 2023 21:02:13 +0300 Subject: [PATCH] t --- .drone.yml | 15 +++++++++++ .gitea/workflows/pipeline.yml | 50 +++++++++++++++++++++++++++++++++++ helper-scripts | 2 +- 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 .drone.yml create mode 100644 .gitea/workflows/pipeline.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..a64db78 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,15 @@ +--- +kind: pipeline +name: create new release + +steps: +- name: create archive + image: mcr.microsoft.com/powershell:lts-7.2-debian-10 + environment: + USERNAME: + from_secret: drone_repo_user + PASSWORD: + from_secret: drone_repo_password + commands: + - | + pwsh -c Get-ChildItem .\src -Recurse -Depth 0 | Compress-Archive -Force -DestinationPath ".\resources\upload\module.zip" diff --git a/.gitea/workflows/pipeline.yml b/.gitea/workflows/pipeline.yml new file mode 100644 index 0000000..59d083f --- /dev/null +++ b/.gitea/workflows/pipeline.yml @@ -0,0 +1,50 @@ +name: Publish Docker image + +on: + push: + branches: + - 'main' + +env: + REPOSITORY: ${{ gitea.repository }} + BUILD_NUMBER: ${{ gitea.run_number }} + DOCKER_REPO_LOGIN: ${{ secrets.DOCKER_REPO_LOGIN }} + DOCKER_REPO_PASSWORD: ${{ secrets.DOCKER_REPO_PASSWORD }} + PORTAINER_TOKEN: ${{ secrets.PORTAINER_TOKEN }} + +jobs: + publish_image: + name: Publish image + runs-on: ubuntu-latest + + container: + image: gitea.kdiva.ru/infrastructure/debian-docker + credentials: + username: ${{ env.DOCKER_REPO_LOGIN }} + password: ${{ env.DOCKER_REPO_PASSWORD }} + + steps: + # - name: Checkout + - name: Checkout ${{env.REPOSITORY}} + uses: actions/checkout@v3 + with: + # repository: infrastructure/nginx + repository: ${{env.REPOSITORY}} + github-server-url: https://gitea.kdiva.ru + + - name: Publish image + uses: https://gitea.kdiva.ru/actions/publish-image@3adc1763ef252a10feb1eb667e768f0a5d80335b + with: + DOCKER_REPO_LOGIN: ${{ env.DOCKER_REPO_LOGIN }} + DOCKER_REPO_PASSWORD: ${{ env.DOCKER_REPO_PASSWORD }} + + redeploy_stack: + name: Redeploy stack + runs-on: ubuntu-latest + needs: "Publish image" + + steps: + - name: Redeploy stack + uses: https://gitea.kdiva.ru/actions/portainer-redeploy@4a0951d52d94ac6504dc20321d6d45f66acd1cc0 + with: + PORTAINER_TOKEN: ${{ env.PORTAINER_TOKEN }} diff --git a/helper-scripts b/helper-scripts index b1524b6..153edfd 160000 --- a/helper-scripts +++ b/helper-scripts @@ -1 +1 @@ -Subproject commit b1524b6710ab92045769dc50d63a85eb576197f8 +Subproject commit 153edfd6d4c91aa957c0b14171f5c676aa4cd58a