From 84b00e140832d49f02be756e1143d79cfcda873d Mon Sep 17 00:00:00 2001 From: Mike Cappeller <32987433+mcappy@users.noreply.github.com> Date: Mon, 25 Oct 2021 22:33:25 -0400 Subject: [PATCH 1/3] moved ci/cd logic to one file --- .github/workflows/build.yml | 16 ------------- .github/workflows/workflow.yml | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 16 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 37043fd..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Build - -on: [push, pull_request, workflow_dispatch] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Build the Docker image - run: docker build -t mcappy/docker-react -f Dockerfile.dev . - - name: Run the test cases - run: docker run -e CI=true mcappy/docker-react yarn test diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..9b85339 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,43 @@ +name: Build + +on: [push, pull_request, workflow_dispatch] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build -t mcappy/docker-react -f Dockerfile.dev . + + test: + runs-on: ubuntu-latest + needs: build + steps: + - name: Run the test cases + run: docker run -e CI=true mcappy/docker-react yarn test + + deploy: + runs-on: ubuntu-latest + needs: [build, test] + steps: + + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Generate deployment package + run: zip -r deploy.zip . -x '*.git*' + + - name: Deploy to EB + uses: einaregilsson/beanstalk-deploy@v18 + with: + aws_access_key: ${{ secrets.ACCESS_KEY_ID }} + aws_secret_key: ${{ secrets.SECRET_ACCESS_KEY }} + application_name: docker + environment_name: Docker-env-1 + version_label: ver-${{ github.sha }} + region: us-east-2 + deployment_package: deploy.zip + + From 86af9f25f9c00ae64b6d6942fc7dd89cb2994921 Mon Sep 17 00:00:00 2001 From: Mike Cappeller <32987433+mcappy@users.noreply.github.com> Date: Mon, 25 Oct 2021 22:33:40 -0400 Subject: [PATCH 2/3] Delete deploy.yml --- .github/workflows/deploy.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index cf0034c..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Beanstalk Deploy -on: - push: - branches: - - master - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - name: Checkout source code - uses: actions/checkout@v2 - - - name: Generate deployment package - run: zip -r deploy.zip . -x '*.git*' - - - name: Deploy to EB - uses: einaregilsson/beanstalk-deploy@v18 - with: - aws_access_key: ${{ secrets.ACCESS_KEY_ID }} - aws_secret_key: ${{ secrets.SECRET_ACCESS_KEY }} - application_name: docker - environment_name: Docker-env-1 - version_label: ver-${{ github.sha }} - region: us-east-2 - deployment_package: deploy.zip From 7082b9bad75b3242fe7c7e4c5e682f39e81bb828 Mon Sep 17 00:00:00 2001 From: Mike Cappeller <32987433+mcappy@users.noreply.github.com> Date: Mon, 25 Oct 2021 22:37:55 -0400 Subject: [PATCH 3/3] Update workflow.yml --- .github/workflows/workflow.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9b85339..0fcde6c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -4,23 +4,18 @@ on: [push, pull_request, workflow_dispatch] jobs: - build: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Build the Docker image run: docker build -t mcappy/docker-react -f Dockerfile.dev . - - test: - runs-on: ubuntu-latest - needs: build - steps: - name: Run the test cases run: docker run -e CI=true mcappy/docker-react yarn test - + deploy: runs-on: ubuntu-latest - needs: [build, test] + needs: test steps: - name: Checkout source code