From e0bf94c4a34d78dc571f5ecb5c4c615582fa1843 Mon Sep 17 00:00:00 2001 From: akvlad Date: Fri, 6 Sep 2024 15:50:12 +0300 Subject: [PATCH 1/6] test release CI --- .github/workflows/test_release.yml | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/test_release.yml diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml new file mode 100644 index 00000000..a53ef9b9 --- /dev/null +++ b/.github/workflows/test_release.yml @@ -0,0 +1,55 @@ +name: 'CI+CD' + +on: + pull_request: + branches: [ master, beta ] + paths-ignore: + - '**.md' + - '**.yml' + - '**.yaml' + workflow_dispatch: + inputs: + TAG_NAME: + description: 'Release Version Tag (0.0.0)' + required: true + +jobs: + node: + name: 'Build & Test Node' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + with: + ref: ${{ github.ref }} + - name: Check Docker secret presence + id: checkdocker + shell: bash + run: | + if [ "$SECRET" == "" ]; then + echo "secretspresent=false" >> $GITHUB_OUTPUT + else + echo "secretspresent=true" >> $GITHUB_OUTPUT + fi + env: + SECRET: ${{ secrets.DOCKERHUB_TOKEN }} + - name: build qryn-view + uses: ./.github/actions/get-view + env: + TAG: v3.3.2 + - name: Set up Docker QEMU + if: ${{ steps.checkdocker.outputs.secretspresent }} + uses: docker/setup-qemu-action@v3.0.0 + with: + platforms: amd64, arm64 + - name: Set up Docker Buildx + if: ${{ steps.checkdocker.outputs.secretspresent }} + uses: docker/setup-buildx-action@v3.0.0 + - name: Build and push to Docker Hub + if: ${{ steps.checkdocker.outputs.secretspresent }} + uses: docker/build-push-action@v5.0.0 + with: + platforms: linux/amd64, linux/arm64 + push: false + tags: | + qxip/qryn:latest + - run: docker run qxip/qryn:latest sh -c 'cd view && ls | grep assets' From 6a1729697267c467df4c87940eeebd2f3d212e6d Mon Sep 17 00:00:00 2001 From: akvlad Date: Fri, 6 Sep 2024 15:51:09 +0300 Subject: [PATCH 2/6] test release CI --- .github/workflows/test_release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml index a53ef9b9..daa6a44d 100644 --- a/.github/workflows/test_release.yml +++ b/.github/workflows/test_release.yml @@ -5,8 +5,6 @@ on: branches: [ master, beta ] paths-ignore: - '**.md' - - '**.yml' - - '**.yaml' workflow_dispatch: inputs: TAG_NAME: From f8195a5eb3c0164d6fdefc002411bf6ed3037807 Mon Sep 17 00:00:00 2001 From: akvlad Date: Fri, 6 Sep 2024 15:58:03 +0300 Subject: [PATCH 3/6] add view into context --- .github/workflows/test_release.yml | 2 +- Dockerfile | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml index daa6a44d..167325ad 100644 --- a/.github/workflows/test_release.yml +++ b/.github/workflows/test_release.yml @@ -46,8 +46,8 @@ jobs: if: ${{ steps.checkdocker.outputs.secretspresent }} uses: docker/build-push-action@v5.0.0 with: + context: "{{defaultContext}}:view" platforms: linux/amd64, linux/arm64 push: false tags: | qxip/qryn:latest - - run: docker run qxip/qryn:latest sh -c 'cd view && ls | grep assets' diff --git a/Dockerfile b/Dockerfile index 4e382c1c..ca7aa971 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,8 @@ FROM node:20.10-slim COPY . /app WORKDIR /app +RUN cd view && ls + RUN groupadd -r qryn && useradd -r -g qryn -m qryn && chown -R qryn:qryn /app USER qryn From 8a82c4c6837b2abeacdc7ed42100be93a6e85eaa Mon Sep 17 00:00:00 2001 From: akvlad Date: Fri, 6 Sep 2024 16:00:32 +0300 Subject: [PATCH 4/6] add view into context --- .github/workflows/test_release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml index 167325ad..50153416 100644 --- a/.github/workflows/test_release.yml +++ b/.github/workflows/test_release.yml @@ -44,9 +44,9 @@ jobs: uses: docker/setup-buildx-action@v3.0.0 - name: Build and push to Docker Hub if: ${{ steps.checkdocker.outputs.secretspresent }} - uses: docker/build-push-action@v5.0.0 + uses: docker/build-push-action@v6 with: - context: "{{defaultContext}}:view" + context: "./view" platforms: linux/amd64, linux/arm64 push: false tags: | From 4c4a02621617b52a7b75db1227436e6722b9f3e2 Mon Sep 17 00:00:00 2001 From: akvlad Date: Fri, 6 Sep 2024 16:01:13 +0300 Subject: [PATCH 5/6] add view into context --- .github/workflows/test_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml index 50153416..fcc74794 100644 --- a/.github/workflows/test_release.yml +++ b/.github/workflows/test_release.yml @@ -46,7 +46,7 @@ jobs: if: ${{ steps.checkdocker.outputs.secretspresent }} uses: docker/build-push-action@v6 with: - context: "./view" + context: "." platforms: linux/amd64, linux/arm64 push: false tags: | From 6d89890f7efaadca84607f9395acd746fcf69a00 Mon Sep 17 00:00:00 2001 From: akvlad Date: Fri, 6 Sep 2024 16:05:51 +0300 Subject: [PATCH 6/6] drop testing stuff --- .github/workflows/build_release.yml | 12 ++++--- .github/workflows/test_release.yml | 53 ----------------------------- Dockerfile | 2 -- 3 files changed, 8 insertions(+), 59 deletions(-) delete mode 100644 .github/workflows/test_release.yml diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 797bd9fa..f943b763 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -90,8 +90,9 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push to Docker Hub if: ${{ steps.checkdocker.outputs.secretspresent }} - uses: docker/build-push-action@v5.0.0 + uses: docker/build-push-action@v6 with: + context: "." platforms: linux/amd64, linux/arm64 push: true tags: | @@ -110,9 +111,10 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push to GHCR - uses: docker/build-push-action@v5.0.0 + uses: docker/build-push-action@v6 with: platforms: linux/amd64, linux/arm64 + context: "." file: ./Dockerfile push: true tags: | @@ -164,8 +166,9 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push to Docker Hub (bun) if: ${{ steps.checkdocker.outputs.secretspresent }} - uses: docker/build-push-action@v5.1.0 + uses: docker/build-push-action@v6 with: + context: "." platforms: linux/amd64, linux/arm64 file: ./Dockerfile_bun push: true @@ -183,8 +186,9 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push to GHCR (bun) - uses: docker/build-push-action@v5.1.0 + uses: docker/build-push-action@v6 with: + context: "." platforms: linux/amd64, linux/arm64 file: ./Dockerfile_bun push: true diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml deleted file mode 100644 index fcc74794..00000000 --- a/.github/workflows/test_release.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: 'CI+CD' - -on: - pull_request: - branches: [ master, beta ] - paths-ignore: - - '**.md' - workflow_dispatch: - inputs: - TAG_NAME: - description: 'Release Version Tag (0.0.0)' - required: true - -jobs: - node: - name: 'Build & Test Node' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.1 - with: - ref: ${{ github.ref }} - - name: Check Docker secret presence - id: checkdocker - shell: bash - run: | - if [ "$SECRET" == "" ]; then - echo "secretspresent=false" >> $GITHUB_OUTPUT - else - echo "secretspresent=true" >> $GITHUB_OUTPUT - fi - env: - SECRET: ${{ secrets.DOCKERHUB_TOKEN }} - - name: build qryn-view - uses: ./.github/actions/get-view - env: - TAG: v3.3.2 - - name: Set up Docker QEMU - if: ${{ steps.checkdocker.outputs.secretspresent }} - uses: docker/setup-qemu-action@v3.0.0 - with: - platforms: amd64, arm64 - - name: Set up Docker Buildx - if: ${{ steps.checkdocker.outputs.secretspresent }} - uses: docker/setup-buildx-action@v3.0.0 - - name: Build and push to Docker Hub - if: ${{ steps.checkdocker.outputs.secretspresent }} - uses: docker/build-push-action@v6 - with: - context: "." - platforms: linux/amd64, linux/arm64 - push: false - tags: | - qxip/qryn:latest diff --git a/Dockerfile b/Dockerfile index ca7aa971..4e382c1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,6 @@ FROM node:20.10-slim COPY . /app WORKDIR /app -RUN cd view && ls - RUN groupadd -r qryn && useradd -r -g qryn -m qryn && chown -R qryn:qryn /app USER qryn