From 1a4e494ce1b1f010122a4d9e4269a7a471f4f001 Mon Sep 17 00:00:00 2001 From: Jose Henrique Date: Fri, 10 Jul 2026 10:33:56 -0300 Subject: [PATCH] updating pipeline --- .gitea/workflows/main.yaml | 53 +++++++++++++++----------------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml index e312794..cc75106 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main.yaml @@ -2,7 +2,9 @@ name: Homepage Build and Deploy on: push: - workflow_dispatch: + branches: + - main + workflow_dispatch: {} env: REGISTRY_HOST: git.ivanch.me @@ -10,46 +12,33 @@ env: IMAGE_NAME: ${{ env.REGISTRY_HOST }}/ivanch/mainpage jobs: - build_ivanch_me: + build: name: Build Homepage Image - runs-on: ubuntu-22.04 - + runs-on: ubuntu-amd64 steps: - name: Check out repository - uses: actions/checkout@v2 - - - name: Log in to Container Registry - run: | - echo "${{ secrets.REGISTRY_PASSWORD }}" \ - | docker login "${{ env.REGISTRY_HOST }}" \ - -u "${{ env.REGISTRY_USERNAME }}" \ - --password-stdin - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: actions/checkout@v4 - name: Build and Push Multi-Arch Image - uses: docker/build-push-action@v6 + uses: ivanch/pipeline-actions/build-and-push@main with: - push: true - context: . - platforms: linux/amd64,linux/arm64 - tags: | - ${{ env.IMAGE_NAME }}:latest + image: ${{ env.IMAGE_NAME }} + registry_password: ${{ secrets.REGISTRY_PASSWORD }} + ssh_key: ${{ secrets.SSH_KEY_DOCKERBUILD }} - deploy_ivanch_me: + deploy: name: Deploy Homepage runs-on: ubuntu-amd64 - needs: build_ivanch_me + needs: build steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Recreate Container - uses: appleboy/ssh-action@v0.1.7 + uses: ivanch/pipeline-actions/ssh-deploy@main with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - port: ${{ secrets.PORT }} - script: | - cd ${{ secrets.DIR }} - docker compose pull - docker compose up -d --force-recreate \ No newline at end of file + ssh_host: ${{ secrets.HOST }} + ssh_username: ${{ secrets.USERNAME }} + ssh_key: ${{ secrets.KEY }} + ssh_port: ${{ secrets.PORT }} + remote_dir: ${{ secrets.DIR }}