From a5c9610178a7c61249e6dee1803809bd501c8792 Mon Sep 17 00:00:00 2001 From: hexxa Date: Sat, 14 May 2022 15:17:10 +0800 Subject: [PATCH] fix(ci): add build step and staging env --- .github/workflows/cd_heroku_staging.yml | 26 +++++++++++++++++++++++++ .github/workflows/ci_build.yml | 8 ++++---- 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/cd_heroku_staging.yml diff --git a/.github/workflows/cd_heroku_staging.yml b/.github/workflows/cd_heroku_staging.yml new file mode 100644 index 0000000..b9d7226 --- /dev/null +++ b/.github/workflows/cd_heroku_staging.yml @@ -0,0 +1,26 @@ +name: cd-heroku + +on: + push: + branches: + - main + - dev-** + - fix-** + pull_request: + branches: [main] + workflow_dispatch: {} + +jobs: + build: + runs-on: ubuntu-latest + environment: + name: staging + url: https://hexxa-quickshare-stage.herokuapp.com/ + steps: + - uses: actions/checkout@v2 + - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action + with: + heroku_api_key: ${{secrets.HEROKU_API_KEY}} + heroku_app_name: "hexxa-quickshare-stage" + heroku_email: "hexxa@outlook.com" + usedocker: true diff --git a/.github/workflows/ci_build.yml b/.github/workflows/ci_build.yml index 2c0277c..c6d982d 100644 --- a/.github/workflows/ci_build.yml +++ b/.github/workflows/ci_build.yml @@ -4,7 +4,7 @@ name: ci-quickshare on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: + branches: - main - dev-** pull_request: @@ -33,16 +33,16 @@ jobs: with: node-version: "12" - run: go version - - name: Install dependencies run: | yarn - - name: Backend tests run: | go test ./... - - name: Frontend tests run: | cd ./src/client/web yarn test + - name: Build + run: | + yarn build