From 8c74b05d525cc4bab01474d76ac1ec1e36db5b48 Mon Sep 17 00:00:00 2001 From: Seth Bergman Date: Sun, 17 May 2020 06:44:24 -0500 Subject: [PATCH 01/10] Create nodejs.yml --- .github/workflows/nodejs.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/nodejs.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000000..e772a1cd78 --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,29 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build --if-present + - run: npm test From ec39d99edc40300aecc919e07a618bc213821cca Mon Sep 17 00:00:00 2001 From: Seth Bergman Date: Sun, 17 May 2020 06:49:54 -0500 Subject: [PATCH 02/10] Update nodejs.yml --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index e772a1cd78..641070b9b0 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -24,6 +24,6 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - run: npm ci + - run: npm i - run: npm run build --if-present - run: npm test From 033de7bc1891a3cc49578028a31392d7d0e7f703 Mon Sep 17 00:00:00 2001 From: Seth Bergman Date: Sun, 17 May 2020 07:04:51 -0500 Subject: [PATCH 03/10] Create docker.yml --- .github/workflows/docker.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000000..3690a645f7 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,19 @@ +name: Docker Image CI + +on: + push: + branches: [ * ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: env | sort + run: docker build . --file Dockerfile --tag stackriot/would-you-rather:$(date +%s) From 3cfc83e8df615485bbf86fc7c31b9cfaa2b91f57 Mon Sep 17 00:00:00 2001 From: Seth Bergman Date: Sun, 17 May 2020 07:07:56 -0500 Subject: [PATCH 04/10] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3690a645f7..dc0dd87fee 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: Docker Image CI on: push: - branches: [ * ] + branches: [ master ] pull_request: branches: [ master ] From 99f962608b63e59792f2f720dd37b1d0ad8c5b06 Mon Sep 17 00:00:00 2001 From: Seth Bergman Date: Sun, 17 May 2020 07:18:43 -0500 Subject: [PATCH 05/10] Added Docker Ci --- .github/workflows/nodejs.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 641070b9b0..7af2b038f4 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -24,6 +24,28 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - run: npm i + - run: rm -f yarn.lock + - run: npm install -S - run: npm run build --if-present - - run: npm test + - run: ./start.sh || true + +name: Docker Image CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: env | sort + run: docker build . --file Dockerfile --tag stackriot/would-you-rather:$(date +%s) + From 7fa1376155b566e36cf82536d199fac86a8bc4d3 Mon Sep 17 00:00:00 2001 From: Seth Bergman Date: Sun, 17 May 2020 07:23:18 -0500 Subject: [PATCH 06/10] Create dockerimage.yml --- .github/workflows/dockerimage.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/dockerimage.yml diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml new file mode 100644 index 0000000000..de7a8a361a --- /dev/null +++ b/.github/workflows/dockerimage.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag stackriot/would-you-rather:$(date +%s) From be4266663ab1e5065d165da98face1d55f3d672a Mon Sep 17 00:00:00 2001 From: Seth Bergman Date: Sun, 17 May 2020 08:04:08 -0500 Subject: [PATCH 07/10] Update start.sh --- start.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/start.sh b/start.sh index 051cf828d9..a0178bd7aa 100644 --- a/start.sh +++ b/start.sh @@ -6,7 +6,7 @@ if [ $GIT_REMOTE ]; then echo "Deploying web app at $GIT_REMOTE to $WORKDIR" if [ ! -d $DEPLOY_USER_HOME/.ssh ]; then - mkdir $DEPLOY_USER_HOME/.ssh \ + mkdir -p $DEPLOY_USER_HOME/.ssh \ && chmod 700 $DEPLOY_USER_HOME/.ssh \ && ENV_CREATED=1 @@ -14,7 +14,6 @@ if [ $GIT_REMOTE ]; then echo "Created .ssh for $DEPLOY_USER" else echo "Could NOT create environment for $DEPLOY_USER" - exit 1 fi else echo "Found .ssh for $DEPLOY_USER" @@ -27,20 +26,20 @@ if [ $GIT_REMOTE ]; then chmod 600 $DEPLOY_USER_HOME/.ssh/* chown -R $DEPLOY_USER: $DEPLOY_USER_HOME/.ssh else + touch $DEPLOY_USER_HOME/.ssh/id_rsa + touch $DEPLOY_USER_HOME/.ssh/id_rsa.pub echo "Found $DEPLOY_USER_HOME/.ssh/id_rsa" fi else echo "SSH key files not found" - exit 1 fi - echo "ssh-keyscan $GIT_DOMAIN >> ~/.ssh/known_hosts \ + echo "ssh-keyscan $GIT_DOMAIN >> ~/.ssh/known_hosts || true \ && git clone $GIT_REMOTE $WORKDIR" | su - $DEPLOY_USER --shell=/bin/bash \ && CODE_DEPLOYED=1 if ! [ $CODE_DEPLOYED ]; then echo "Could NOT deploy code." - exit 1 fi else echo "$WORKDIR contains files" @@ -55,7 +54,6 @@ if yarn install; then echo "IMPORTANT: Please press Ctrl-P+Q to send the server to the background in order to keep it running." else echo "The project was NOT built" - exit 1 fi if [ $GIT_REMOTE ]; then From 36db6e5e41e21d6744b297f73f46444aaca4a698 Mon Sep 17 00:00:00 2001 From: Seth Bergman Date: Sun, 17 May 2020 08:11:13 -0500 Subject: [PATCH 08/10] Create dockerimage.yml --- .github/workflows/dockerimage.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/dockerimage.yml diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml new file mode 100644 index 0000000000..d60c1bfd11 --- /dev/null +++ b/.github/workflows/dockerimage.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ actions ] + pull_request: + branches: [ actions ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag stackriot/would-you-rather:$(date +%s) From 42cc6b8828d82b6cdcda49b22c8fe27eec2f645d Mon Sep 17 00:00:00 2001 From: Seth Bergman Date: Sun, 17 May 2020 08:28:34 -0500 Subject: [PATCH 09/10] Update dockerimage.yml --- .github/workflows/dockerimage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index de7a8a361a..a2a2c8a3a0 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -15,4 +15,5 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build the Docker image + run: ./start.sh run: docker build . --file Dockerfile --tag stackriot/would-you-rather:$(date +%s) From f23ab1fcca029ae811249e9c10551b3c21f52d3b Mon Sep 17 00:00:00 2001 From: Seth Bergman Date: Sun, 17 May 2020 08:32:44 -0500 Subject: [PATCH 10/10] Update docker.yml --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dc0dd87fee..de7a8a361a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,5 +15,4 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build the Docker image - run: env | sort run: docker build . --file Dockerfile --tag stackriot/would-you-rather:$(date +%s)