From 20b99710b56fe684e4064946273c4d60630d5a7b Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Mon, 19 Aug 2024 12:09:56 +0200 Subject: [PATCH] fix: test deployment --- .github/workflows/deploy-test-server.yml | 8 +++----- playground/.dockerignore | 8 ++++++++ Dockerfile => playground/Dockerfile | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 playground/.dockerignore rename Dockerfile => playground/Dockerfile (88%) diff --git a/.github/workflows/deploy-test-server.yml b/.github/workflows/deploy-test-server.yml index 94923b0..abeb4be 100644 --- a/.github/workflows/deploy-test-server.yml +++ b/.github/workflows/deploy-test-server.yml @@ -42,11 +42,9 @@ jobs: - name: Build the packages run: yarn run build - - name: Remove the installed dependencies - run: rm -rf node_modules - - name: Build a Docker image of the playground run: | + cd playground docker build \ --build-arg PUBLIC_URL=${{ secrets.TEST_URL }} \ -t strapi-playground:latest . @@ -58,7 +56,7 @@ jobs: host: ${{ secrets.SSH_HOST }} username: ${{ secrets.SSH_CI_USERNAME }} password: ${{ secrets.SSH_CI_PASSWORD }} - source: strapi-playground-latest.tar + source: playground/strapi-playground-latest.tar target: /var/lib/dokku/data/storage/strapi/docker-images - name: Deploy the Dokku app based on the Docker image @@ -69,7 +67,7 @@ jobs: password: ${{ secrets.SSH_CI_PASSWORD }} script_stop: true script: | - sudo docker load -i /var/lib/dokku/data/storage/strapi/docker-images/strapi-playground-latest.tar + sudo docker load -i /var/lib/dokku/data/storage/strapi/docker-images/playground/strapi-playground-latest.tar STRAPI_LATEST_IMAGE=$(sudo docker images --format "{{.ID}}" strapi-playground:latest) sudo docker tag strapi-playground:latest strapi-playground:$STRAPI_LATEST_IMAGE dokku git:from-image strapi strapi-playground:$STRAPI_LATEST_IMAGE diff --git a/playground/.dockerignore b/playground/.dockerignore new file mode 100644 index 0000000..96ecbea --- /dev/null +++ b/playground/.dockerignore @@ -0,0 +1,8 @@ +.tmp/ +.cache/ +.git/ +build/ +node_modules/ +.env +data/ +backup/ diff --git a/Dockerfile b/playground/Dockerfile similarity index 88% rename from Dockerfile rename to playground/Dockerfile index 19b0895..795690e 100644 --- a/Dockerfile +++ b/playground/Dockerfile @@ -3,11 +3,11 @@ FROM node:18-alpine3.18 RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev WORKDIR /opt/ -COPY playground/package.json playground/yarn.lock ./ +COPY ./package.json ./yarn.lock ./ RUN npm config set fetch-retry-maxtimeout 600000 -g && yarn install WORKDIR /opt/app -COPY playground . +COPY . . ENV PATH /opt/node_modules/.bin:$PATH # Register all the args passed through the build command