From a2bfae1fb76a633c7481ea61148982170bfd38a6 Mon Sep 17 00:00:00 2001 From: Sten Laane <21343173+StenAL@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:25:54 +0300 Subject: [PATCH] CI test --- .github/workflows/client-cd.yml | 15 ++--- .github/workflows/server-cd.yml | 100 ++++++++++++++++---------------- 2 files changed, 58 insertions(+), 57 deletions(-) diff --git a/.github/workflows/client-cd.yml b/.github/workflows/client-cd.yml index 6adc807..20065b7 100644 --- a/.github/workflows/client-cd.yml +++ b/.github/workflows/client-cd.yml @@ -7,12 +7,12 @@ on: paths: - "client/**" # limit workflow only to changes in frontend folder - ".github/workflows/server-cd.yml" - pull_request: - branches: - - main - paths: - - "client/**" - - ".github/workflows/client-cd.yml" +# pull_request: +# branches: +# - main +# paths: +# - "client/**" +# - ".github/workflows/client-cd.yml" defaults: @@ -45,7 +45,7 @@ jobs: publish: needs: build - if: github.ref == 'refs/heads/main' +# if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - name: checkout current repository @@ -73,6 +73,7 @@ jobs: username: ${{ secrets.SSH_USER }} key: ${{ secrets.SSH_KEY }} port: ${{ secrets.SSH_PORT }} + protocol: tcp6 source: "client/build/**" target: "/var/www/stonks" strip_components: 2 diff --git a/.github/workflows/server-cd.yml b/.github/workflows/server-cd.yml index ad64fe6..020dc9b 100644 --- a/.github/workflows/server-cd.yml +++ b/.github/workflows/server-cd.yml @@ -15,63 +15,63 @@ on: - ".github/workflows/server-cd.yml" jobs: - build: - runs-on: ubuntu-latest - steps: - - name: checkout current repository - uses: actions/checkout@v4 - - - name: set up Java 21 - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'temurin' - - - name: build application jar - uses: gradle/actions/setup-gradle@v3 - with: - gradle-version: wrapper - arguments: build - build-root-directory: server - - - name: create server artifact from jar - if: github.ref == 'refs/heads/main' - uses: actions/upload-artifact@v4 - with: - name: server - path: server/build +# build: +# runs-on: ubuntu-latest +# steps: +# - name: checkout current repository +# uses: actions/checkout@v4 +# +# - name: set up Java 21 +# uses: actions/setup-java@v4 +# with: +# java-version: '21' +# distribution: 'temurin' +# +# - name: build application jar +# uses: gradle/actions/setup-gradle@v3 +# with: +# gradle-version: wrapper +# arguments: build +# build-root-directory: server +# +# - name: create server artifact from jar +## if: github.ref == 'refs/heads/main' +# uses: actions/upload-artifact@v4 +# with: +# name: server +# path: server/build publish: needs: build - if: github.ref == 'refs/heads/main' +# if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - name: checkout current repository uses: actions/checkout@v4 - - name: download server artifact - uses: actions/download-artifact@v4 - with: - name: server - path: server/build - - - name: set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: log in to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: build and publish server Docker image - uses: docker/build-push-action@v6 - with: - context: server - file: server/docker/Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - tags: stenal/baltic-stock-server:latest +# - name: download server artifact +# uses: actions/download-artifact@v4 +# with: +# name: server +# path: server/build +# +# - name: set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# +# - name: log in to DockerHub +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.DOCKER_USERNAME }} +# password: ${{ secrets.DOCKER_PASSWORD }} +# +# - name: build and publish server Docker image +# uses: docker/build-push-action@v6 +# with: +# context: server +# file: server/docker/Dockerfile +# platforms: linux/amd64,linux/arm64 +# push: true +# tags: stenal/baltic-stock-server:latest - name: setup SSH shell: bash @@ -81,7 +81,7 @@ jobs: touch /home/runner/.ssh/id_rsa echo -e "${{secrets.SSH_KEY}}" > /home/runner/.ssh/id_rsa chmod 700 /home/runner/.ssh/id_rsa - ssh-keyscan -t rsa,dsa,ecdsa,ed25519 ${{secrets.SSH_HOST}} >> /home/runner/.ssh/known_hosts + ssh-keyscan -t rsa,dsa,ecdsa,ed25519 laane.xyz >> /home/runner/.ssh/known_hosts - name: run Ansible deployment playbook shell: bash