From 7950e6387c2d4357f410c2a247183b343341c4e9 Mon Sep 17 00:00:00 2001 From: Harold Treen Date: Sun, 16 Jul 2023 18:58:05 -0400 Subject: [PATCH 1/6] Skip calibre install --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3ec5c6..cd2cfae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,7 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} tag_with_ref: true tags: latest,master + build_args: converter=kindlegen cache_froms: haroldtreen/epub-press/server:latest deploy_stage: if: ${{ contains(github.ref, 'stage') }} From 9e913f11dde52846eb7ac8a6a8146f25027c7832 Mon Sep 17 00:00:00 2001 From: Harold Treen Date: Sun, 16 Jul 2023 19:39:40 -0400 Subject: [PATCH 2/6] Update publish step --- .github/workflows/build.yml | 52 +++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd2cfae..5780897 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,39 +4,41 @@ name: Build on: [push, pull_request] jobs: - test_and_lint: - runs-on: ubuntu-latest - steps: - - name: Use Node.js 14 - uses: actions/setup-node@v1 - with: - node-version: 13 - - uses: actions/checkout@v2 - - run: npm ci - - run: npm run lint - - uses: paambaati/codeclimate-action@v2.6.0 - env: - CC_TEST_REPORTER_ID: 96ffb20ecb0b933c764cff83a89880079aa11a32874c611fc02bfbfc0d021611 - with: - coverageCommand: npm run test:coverage - coverageLocations: ${{ github.workspace }}/coverage/lcov.info:lcov + # test_and_lint: + # runs-on: ubuntu-latest + # steps: + # - name: Use Node.js 14 + # uses: actions/setup-node@v1 + # with: + # node-version: 13 + # - uses: actions/checkout@v2 + # - run: npm ci + # - run: npm run lint + # - uses: paambaati/codeclimate-action@v2.6.0 + # env: + # CC_TEST_REPORTER_ID: 96ffb20ecb0b933c764cff83a89880079aa11a32874c611fc02bfbfc0d021611 + # with: + # coverageCommand: npm run test:coverage + # coverageLocations: ${{ github.workspace }}/coverage/lcov.info:lcov publish: if: ${{ contains(github.ref, 'master') || contains(github.ref, 'stage') }} runs-on: ubuntu-latest - needs: [test_and_lint] + # needs: [test_and_lint] steps: - uses: actions/checkout@v2 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Publish Docker - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v4 with: - repository: haroldtreen/epub-press/server - registry: docker.pkg.github.com - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - tag_with_ref: true + context: . tags: latest,master - build_args: converter=kindlegen - cache_froms: haroldtreen/epub-press/server:latest + build-args: converter=kindlegen + cache-from: haroldtreen/epub-press/server:latest deploy_stage: if: ${{ contains(github.ref, 'stage') }} runs-on: ubuntu-latest From e29bc465755c4f84a9464fca23aa62ffa1c2ae6d Mon Sep 17 00:00:00 2001 From: Harold Treen Date: Sun, 16 Jul 2023 19:56:27 -0400 Subject: [PATCH 3/6] Update scp-action --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5780897..d71eed5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,12 +50,11 @@ jobs: env: PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - name: Copy files - uses: appleboy/scp-action@master - env: - HOST: ${{ env.STAGE_HOST }} - USERNAME: ${{ secrets.SSH_USERNAME }} - KEY: ${{ secrets.SSH_KEY }} + uses: appleboy/scp-action@v0.1.4 with: + username: ${{ secrets.SSH_USERNAME }} + key: ${{ secrets.SSH_KEY }} + host: ${{ env.STAGE_HOST }} source: "docker-compose.stage.yaml,envs/stage.env,prometheus.yml" target: "/usr/local/epub-press" passphrase: ${{ secrets.SSH_PASSPHRASE }} From e3cb64de44fa85ea7c9c39bdea8a80facfee78b0 Mon Sep 17 00:00:00 2001 From: Harold Treen Date: Sun, 16 Jul 2023 21:58:48 -0400 Subject: [PATCH 4/6] Extend timeout --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d71eed5..6e16931 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,6 +57,7 @@ jobs: host: ${{ env.STAGE_HOST }} source: "docker-compose.stage.yaml,envs/stage.env,prometheus.yml" target: "/usr/local/epub-press" + timeout: 90s passphrase: ${{ secrets.SSH_PASSPHRASE }} - name: Restart Docker uses: appleboy/ssh-action@master From dbb551d94bb338d63c11125406c4aab1ce74a48d Mon Sep 17 00:00:00 2001 From: Harold Treen Date: Sun, 16 Jul 2023 22:02:44 -0400 Subject: [PATCH 5/6] Downgrade version --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e16931..5b74d76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,14 +50,13 @@ jobs: env: PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - name: Copy files - uses: appleboy/scp-action@v0.1.4 + uses: appleboy/scp-action@v0.1.3 with: username: ${{ secrets.SSH_USERNAME }} key: ${{ secrets.SSH_KEY }} host: ${{ env.STAGE_HOST }} source: "docker-compose.stage.yaml,envs/stage.env,prometheus.yml" target: "/usr/local/epub-press" - timeout: 90s passphrase: ${{ secrets.SSH_PASSPHRASE }} - name: Restart Docker uses: appleboy/ssh-action@master From 75ca27b3a8e67dac9b00282b8095932d34b42d28 Mon Sep 17 00:00:00 2001 From: Harold Treen Date: Sun, 16 Jul 2023 22:20:53 -0400 Subject: [PATCH 6/6] Update prod deploy and uncomment tests --- .github/workflows/build.yml | 43 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b74d76..2aaabbb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,26 +4,26 @@ name: Build on: [push, pull_request] jobs: - # test_and_lint: - # runs-on: ubuntu-latest - # steps: - # - name: Use Node.js 14 - # uses: actions/setup-node@v1 - # with: - # node-version: 13 - # - uses: actions/checkout@v2 - # - run: npm ci - # - run: npm run lint - # - uses: paambaati/codeclimate-action@v2.6.0 - # env: - # CC_TEST_REPORTER_ID: 96ffb20ecb0b933c764cff83a89880079aa11a32874c611fc02bfbfc0d021611 - # with: - # coverageCommand: npm run test:coverage - # coverageLocations: ${{ github.workspace }}/coverage/lcov.info:lcov + test_and_lint: + runs-on: ubuntu-latest + steps: + - name: Use Node.js 14 + uses: actions/setup-node@v1 + with: + node-version: 13 + - uses: actions/checkout@v2 + - run: npm ci + - run: npm run lint + - uses: paambaati/codeclimate-action@v2.6.0 + env: + CC_TEST_REPORTER_ID: 96ffb20ecb0b933c764cff83a89880079aa11a32874c611fc02bfbfc0d021611 + with: + coverageCommand: npm run test:coverage + coverageLocations: ${{ github.workspace }}/coverage/lcov.info:lcov publish: if: ${{ contains(github.ref, 'master') || contains(github.ref, 'stage') }} runs-on: ubuntu-latest - # needs: [test_and_lint] + needs: [test_and_lint] steps: - uses: actions/checkout@v2 - name: Login to Docker Hub @@ -82,12 +82,11 @@ jobs: env: PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - name: Copy files - uses: appleboy/scp-action@master - env: - HOST: ${{ env.PROD_HOST }} - USERNAME: ${{ secrets.SSH_USERNAME }} - KEY: ${{ secrets.SSH_KEY }} + uses: appleboy/scp-action@v0.1.3 with: + username: ${{ secrets.SSH_USERNAME }} + key: ${{ secrets.SSH_KEY }} + host: ${{ env.STAGE_HOST }} source: "docker-compose.prod.yaml,envs/prod.env,prometheus.yml" target: "/usr/local/epub-press" passphrase: ${{ secrets.SSH_PASSPHRASE }}