From 621c97ab39a267c8de6a7bf317558e4b611b1063 Mon Sep 17 00:00:00 2001 From: adueck Date: Mon, 27 Nov 2023 14:43:46 +0400 Subject: [PATCH] new deploy CI --- .github/workflows/{main.yml => deploy.yml} | 23 ++++++++++---------- .github/workflows/docker.yml | 25 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 11 deletions(-) rename .github/workflows/{main.yml => deploy.yml} (57%) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/main.yml b/.github/workflows/deploy.yml similarity index 57% rename from .github/workflows/main.yml rename to .github/workflows/deploy.yml index 676ce54..50966a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/deploy.yml @@ -24,14 +24,15 @@ jobs: port: ${{ secrets.PORT }} key: ${{ secrets.KEY }} source: "./*" - target: "." - # - name: unpack tarball and restart app - # uses: appleboy/ssh-action@v1.0.0 - # with: - # host: ${{ secrets.HOST }} - # username: ${{ secrets.USERNAME }} - # key: ${{ secrets.KEY }} - # port: ${{ secrets.PORT }} - # script: - - # pm2 restart account + target: "rtl-epub-maker" + - name: unpack tarball and restart app + uses: appleboy/ssh-action@v1.0.0 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script: | + rm -rf apps/live/rtl-epub-maker + mv rtl-epub-maker apps/live + pm2 restart account diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..b9d3241 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,25 @@ +name: CI +# TODO: use caching +on: + push: + branches: [master] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/rtl-epub-maker:latest