From fa19bc502e0e526e480be125591f04bf175f9f26 Mon Sep 17 00:00:00 2001 From: skeris Date: Tue, 28 Jan 2025 15:43:03 +0300 Subject: [PATCH] xdeploy by push to registry --- .gitea/workflows/deploy.yml | 26 +++++++++++++------------ Taskfile.yml | 12 ++++++++++++ deployments/staging/docker-compose.yaml | 2 +- 3 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 Taskfile.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 51b0b4b..9a11108 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -8,17 +8,19 @@ on: - 'staging' jobs: - CreateImage: - runs-on: [apimetrics] - uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.1.8.- - with: - runner: apimetrics - secrets: - REGISTRY_USER: ${{ secrets.REGISTRY_USER }} - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} DeployService: runs-on: [frontstaging] - needs: CreateImage - uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.1.6-p - with: - runner: frontstaging + container: + image: gitea.pena:3000/penadevops/container-images/node-compose:main + env: + GITHUB_RUN_NUMBER: "${{ inputs.actionid }}" + volumes: + - /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock + steps: + - name: Check out repository code + uses: http://gitea.pena:3000/PenaDevops/actions.git/checkout@v1 + - run: printenv + - run: GITHUB_RUN_NUMBER=${{ gitea.run_id }} compose -f deployments/${{ gitea.ref_name }}/docker-compose.yaml up -d + # uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.1.6-p + # with: + # runner: frontstaging diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..8b11b6b --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,12 @@ +version: "3" + +tasks: + build-image: + cmds: + - podman build -t gitea.pena/penaside/adminfront:$(git rev-parse --abbrev-ref HEAD).$(git rev-parse HEAD) . + push: + cmds: + - task: build-image + - cmd: podman login gitea.pena + - cmd: podman push gitea.pena/penaside/adminfront:$(git rev-parse --abbrev-ref HEAD).$(git rev-parse HEAD) + diff --git a/deployments/staging/docker-compose.yaml b/deployments/staging/docker-compose.yaml index b9d9737..c8dc0a4 100644 --- a/deployments/staging/docker-compose.yaml +++ b/deployments/staging/docker-compose.yaml @@ -3,7 +3,7 @@ services: admin_front: container_name: admin_front restart: unless-stopped - image: gitea.pena:3000/penaside/adminfront/staging:$GITHUB_RUN_NUMBER + image: gitea.pena:3000/penaside/adminfront:staging.a6f3ab6136f69ad770aa31b2a67500e196e9ba4b ports: - 10.7.0.18:80:80 - 10.7.0.18:443:443