-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from pluginpal/feature/test-server-deployment
fix: test deployment
- Loading branch information
Showing
2 changed files
with
11 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|