Skip to content

Commit

Permalink
Merge pull request #174 from pluginpal/feature/test-server-deployment
Browse files Browse the repository at this point in the history
fix: test deployment
  • Loading branch information
boazpoolman authored Aug 19, 2024
2 parents d08dd2e + 00ed6f6 commit f84bc1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/deploy-test-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,23 @@ 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:latest .
docker save -o strapi-latest.tar strapi:latest
-t strapi-playground:latest .
docker save -o strapi-playground-latest.tar strapi-playground:latest
- name: Transfer the Docker image to the Dokku server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_CI_USERNAME }}
password: ${{ secrets.SSH_CI_PASSWORD }}
source: playground/strapi-latest.tar
source: strapi-playground-latest.tar
target: /var/lib/dokku/data/storage/strapi/docker-images

- name: Deploy the Dokku app based on the Docker image
Expand All @@ -67,9 +69,9 @@ jobs:
password: ${{ secrets.SSH_CI_PASSWORD }}
script_stop: true
script: |
sudo docker load -i /var/lib/dokku/data/storage/strapi/docker-images/playground/strapi-latest.tar
STRAPI_LATEST_IMAGE=$(sudo docker images --format "{{.ID}}" strapi:latest)
sudo docker tag strapi:latest strapi:$STRAPI_LATEST_IMAGE
sudo docker load -i /var/lib/dokku/data/storage/strapi/docker-images/strapi-playground-latest.tar
STRAPI_LATEST_IMAGE=$(sudo docker images --format "{{.ID}}" strapi-playground:latest)
sudo docker tag strapi-playground:latest strapi:$STRAPI_LATEST_IMAGE
dokku git:from-image strapi strapi:$STRAPI_LATEST_IMAGE
sudo docker system prune --all --force
5 changes: 2 additions & 3 deletions playground/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +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 package.json yarn.lock ./
COPY playground/package.json playground/yarn.lock ./
RUN npm config set fetch-retry-maxtimeout 600000 -g && yarn install
RUN SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm_config_arch=x64 npm_config_platform=linuxmusl yarn add [email protected]

WORKDIR /opt/app
COPY . .
COPY playground .
ENV PATH /opt/node_modules/.bin:$PATH

# Register all the args passed through the build command
Expand Down

0 comments on commit f84bc1a

Please sign in to comment.