From 6d66eab78bd37b683a9a5c5e069ed4f4b1813094 Mon Sep 17 00:00:00 2001 From: Derek Worthen Date: Wed, 9 Sep 2020 10:23:40 -0700 Subject: [PATCH] Create ci.yml --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..18e80b4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the main branch +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Install pnpm + run: npm install -g pnpm + + - name: Install dependencies + run: pnpm install + + - name: pnpm CI + run: pnpm ci + env: + NODE_ENV: production + CI: true + AUTH_AUTHORITY: ${{ secrets.AUTH_AUTHORITY }} + AUTH_CLIENT_ID: ${{ secrets.AUTH_CLIENT_ID }} + AUTH_DISABLED: 0 + AUTH_REDIRECT_URI: ${{ secrets.AUTH_REDIRECT_URI }} + CLIENT_CD_ENABLED: true + SERVER_CD_ENABLED: true + GRAPHQL_API: ${{ secrets.GRAPHQL_API }} + + deploy: + name: Deploy + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + needs: + - build + steps: + + - name: deploy cient + run: pnpm deploy:client + env: + CLIENT_DEPLOY_AZURE_CONTAINER: ${{ secrets.CLIENT_DEPLOY_AZURE_CONTAINER }} + CLIENT_DEPLOY_AZURE_CONTAINER_KEY: ${{ CLIENT_DEPLOY_AZURE_CONTAINER_KEY }}