From 11604f73b773f73c5a52ba055ace64d60cb2a959 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 26 Nov 2019 01:45:27 +0100 Subject: [PATCH] add deploy step --- .github/workflows/ci.yml | 14 +++++++++++++- scripts/deploy.sh | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e07fcf7..e222c52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: 'CI/CD Pipeline' -on: [push] +on: [push, pull_request] jobs: test: @@ -57,3 +57,15 @@ jobs: with: name: public path: public + + deploy: + needs: build + if: github.event_name == 'pull_request' || github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions/download-artifact@v1 + with: + name: public + - run: ./scripts/deploy.sh diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 2170ca5..7954dd0 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -63,14 +63,14 @@ function ping { ## ## check for pull request against master ## -if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then +if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then s3sync $AWS_S3_BUCKET_BETA ## ## check for master push which is no pull request ## -elif [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] || [ "$TRAVIS" != true ]; then +elif [ "$GITHUB_REF" == "refs/heads/master" ]; then s3sync $AWS_S3_BUCKET