From a8ea03fea6eb5ef03dea8d3c991019384b9913a2 Mon Sep 17 00:00:00 2001 From: Prasanna Chiang Date: Tue, 2 Jan 2024 17:31:05 +0800 Subject: [PATCH] chore: migrate ci/cd pipelines to github actions and argo cd --- .github/workflows/ci.yaml | 67 +++++++++++++++++++++++++++++++++++ .travis.yml => .travis.yml.bk | 0 2 files changed, 67 insertions(+) create mode 100644 .github/workflows/ci.yaml rename .travis.yml => .travis.yml.bk (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..dac02e7e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,67 @@ +name: ci + +on: + push: + branches: + - '**' + tags: + - '**' + workflow_dispatch: + +jobs: + cancel: + runs-on: quid-runner + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + with: + all_but_latest: true + + test-and-deploy: + runs-on: frontend-ci-high-memory-runner + steps: + - name: Checkout Master + uses: actions/checkout@v4 + if: ${{ github.ref == 'refs/heads/master' }} + with: + fetch-depth: 50 + + - name: Checkout Non-Master + uses: actions/checkout@v4 + if: ${{ github.ref != 'refs/heads/master' }} + + - name: Install Yarn + run: | + curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.17.3 + echo "$HOME/.yarn/bin" >> $GITHUB_PATH + + - uses: actions/setup-node@v4 + with: + node-version: 11.10.1 + + - name: Type Checks and Unit Tests + run: | + flow check + react-app-rewired test --coverage --colorsyarn --frozen-lockfile && yarn build + + - name: Build + run: yarn build + + - name: Publish gh-pages + if: ${{ github.ref == 'refs/heads/master' }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./styleguide + keep_files: true + user_name: 'quid-bot' + user_email: 'infratructure@quid.com' + cname: ui.quid.com + + - name: Publish to npm + if: ${{ github.ref == 'refs/heads/master' }} + run: | + export GITHUB_NAME=quid-bot + export GITHUB_EMAIL=infratructure@quid.com + export AUTOMATED_WRITE_AUTH=${{ secrets.AUTOMATED_WRITE_AUTH }} + scripts/deploy.sh diff --git a/.travis.yml b/.travis.yml.bk similarity index 100% rename from .travis.yml rename to .travis.yml.bk