Skip to content

Testing - Surge deploy #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Oct 20, 2019
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/sh

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we delete this file since its not being used, or do we still plan to move the build steps here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make a note. Actually previously in this PR: #46 , I used to call the build.sh and deploy.sh separately. But now we were facing issue so I make it in one script file.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it! I did see your comment in deploy.sh after I made this comment. Maybe we just delete or add a #deprecated / not being used comment in build.sh?

hugo
git submodule update --init
sudo hugo
ls

17 changes: 14 additions & 3 deletions .scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
#!/bin/sh

# Should be moved to build.sh
# NOTE: Running build.sh and then deploy.sh is not finding the public
# folder which is generated after the build command (hugo).
git submodule update --init
hugo

npm install -g surge

echo "REF value is ${REF}"

PR_NUMBER="$(echo $REF | cut -d'/' -f3)"
PROJECT_BUILD="./public"
DOMAIN="pr-${PR_NUMBER}-numpy.org-newsite.surge.sh"
echo "PR_NUMBER: $PR_NUMBER"
echo "SURGE_LOGIN: $SURGE_LOGIN"
echo "SURGE_TOKEN: $SURGE_TOKEN"
ls
echo "---"
ls "./public"

surge --project $PROJECT_BUILD --domain $DOMAIN;

surge --project "./public" --domain "pr-${PR_NUMBER}-numpy.org-newsite.surge.sh";

echo ::set-output name=deployed-domain::"pr-${PR_NUMBER}-numpy.org-newsite.surge.sh"
2 changes: 1 addition & 1 deletion .scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ location="$(which hugo)"
echo "Hugo binary location: $location"

version="$(hugo version)"
echo "Hugo binary version: $version"
echo "Hugo binary version: $version"
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ FROM node:10-alpine
ADD . ./app
WORKDIR /app

RUN export PR_NUMBER=$(echo ${REF} | cut -d'/' -f3)

RUN apk add --no-cache curl
RUN apk add --no-cache wget
RUN apk add --no-cache bash
RUN apk add --no-cache git

RUN chmod +x .scripts/install.sh
RUN chmod +x .scripts/build.sh
RUN chmod +x .scripts/deploy.sh

RUN .scripts/install.sh
RUN .scripts/build.sh

RUN echo ${REF}
RUN echo "$REF"
RUN export PR_NUMBER=$(echo ${REF} | cut -d'/' -f3)

ENTRYPOINT .scripts/deploy.sh; /bin/bash