From c0bf9b4ae4c91c012d9bb418e5ef86b15fd7c2c4 Mon Sep 17 00:00:00 2001 From: Jonas Ohrstrom Date: Wed, 23 Mar 2022 22:14:21 +0100 Subject: [PATCH] fix: cleaned up ci pipeline. (#9) --- __full_workflows/ci.yaml | 122 -------------------------------------- __full_workflows/gcp.yaml | 101 ------------------------------- 2 files changed, 223 deletions(-) delete mode 100644 __full_workflows/ci.yaml delete mode 100644 __full_workflows/gcp.yaml diff --git a/__full_workflows/ci.yaml b/__full_workflows/ci.yaml deleted file mode 100644 index a70c3782..00000000 --- a/__full_workflows/ci.yaml +++ /dev/null @@ -1,122 +0,0 @@ -name: CI - -on: [push] - -jobs: - preflight-fe: - runs-on: ubuntu-latest - name: Frontend preflight - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 - with: - node-version: '16' - - run: npm install -g yarn - - run: yarn install --dev - - run: yarn lint - - preflight-be: - runs-on: ubuntu-latest - name: Backend preflight - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - with: - python-version: '3.9' - architecture: 'x64' - - run: pip install black - - run: black --version - - run: black ./core/ --check - - run: pip install poetry==1.1.13 - - run: poetry export --without-hashes --dev -f requirements.txt | pip install -r /dev/stdin -# - run: prospector -p ./core/ - - test-be: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.9', '3.10'] - name: Backend tests (python ${{ matrix.python-version }}) - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - with: -# python-version: '3.9' - python-version: ${{ matrix.python-version }} - architecture: 'x64' - - run: pip install poetry==1.1.13 - - run: poetry export --without-hashes --dev -f requirements.txt | pip install -r /dev/stdin - - run: make test-be - - test-fe: - runs-on: ubuntu-latest - name: Frontend tests - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 - with: - node-version: '16' - - run: npm install -g yarn - - run: yarn install --dev - - run: yarn test:unit - - test-e2e: - runs-on: ubuntu-latest - name: E2E tests - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 - with: - node-version: '16' - - uses: actions/setup-python@v3 - with: - python-version: '3.9' - architecture: 'x64' - - run: npm install -g yarn - - run: yarn install - - run: yarn build - - run: pip install poetry==1.1.13 - - run: poetry export --without-hashes --dev -f requirements.txt | pip install -r /dev/stdin - - run: make test-e2e - - uses: actions/upload-artifact@v3 - with: - name: e2e-test-screenshots - path: screenshots - - -# release: -# needs: [preflight-fe, preflight-be, test-be, test-fe, test-e2e] -# runs-on: ubuntu-latest -# if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):') -# steps: -# - uses: actions/setup-python@v3 -# with: -# python-version: 3.9 -# - uses: actions/checkout@v3 -# - name: Semantic release -# run: | -# pip install python-semantic-release -# git config user.name github-actions -# git config user.email github-actions@github.com -# semantic-release publish - - -# deploy: -# needs: [preflight-fe, preflight-be, test-be, test-fe, test-e2e] -# runs-on: ubuntu-latest -# if: github.ref == 'refs/heads/main' -# steps: -# - name: Set up GCP SDK -# uses: google-github-actions/setup-gcloud@v0 -# with: -# project_id: ${{ secrets.GCP_PROJECT_ID }} -# service_account_key: ${{ secrets.GCP_SA_KEY }} -# export_default_credentials: true -# - name: Checkout -# uses: actions/checkout@v3 -# - name: Submit to cloudbuild -# run: gcloud builds submit --async diff --git a/__full_workflows/gcp.yaml b/__full_workflows/gcp.yaml deleted file mode 100644 index 6a30a1bf..00000000 --- a/__full_workflows/gcp.yaml +++ /dev/null @@ -1,101 +0,0 @@ -name: GCP - -#on: [push] - -on: - workflow_run: - workflows: [CI] - branches: [main] - types: - - completed - -env: - IMAGE_NAME: obr-web - GH_REGISTRY: ghcr.io - GH_ORGANIZATION: digris - GCP_PROJECT_ID: open-broadcast - GCP_SERVICE: obr-web - -jobs: - deploy: - runs-on: ubuntu-latest - - permissions: - contents: read - packages: write - id-token: write - -# if: github.ref == 'refs/heads/main' - if: github.event.workflow_run.conclusion == 'success' - steps: - - name: Checkout - uses: actions/checkout@v3 - - # prepare github - - name: Authorize github container registry - uses: docker/login-action@v1 - with: - registry: ${{ env.GH_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # prepare GCP - - name: GCP auth - uses: google-github-actions/auth@v0 - with: - credentials_json: ${{ secrets.GCP_SA_KEY }} - - - name: Set up cloud SDK - uses: google-github-actions/setup-gcloud@v0 - with: - project_id: ${{ env.GCP_PROJECT_ID }} - - - name: Authorize GCP container registry - run: gcloud auth configure-docker - - # build & push image - - name: Set up docker buildx - uses: docker/setup-buildx-action@v1 - - - name: Set outputs - id: vars - run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - - name: Extract metadata (tags, labels) for image - id: meta - uses: docker/metadata-action@v2 - with: - images: | - ${{ env.GH_REGISTRY }}/${{ env.GH_ORGANIZATION }}/${{ env.IMAGE_NAME }} - gcr.io/${{ env.GCP_PROJECT_ID }}/${{ env.GCP_SERVICE }} - tags: | - type=ref,event=branch - type=sha - - - name: Build and push Docker image - uses: docker/build-push-action@v2 - with: - context: . - file: docker/Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} -# tags: | -# gcr.io/${{ env.GCP_PROJECT_ID }}/${{ env.GCP_SERVICE }}:${{ github.sha }} - build-args: | - GIT_SHORT_SHA=${{ steps.vars.outputs.sha_short }} - - - name: Deploy to GCP cloud run - run: gcloud builds submit --config gcp/migrate-deploy.yaml --timeout=1200 --async - - - name: Inform slack channel - id: slack - uses: slackapi/slack-github-action@v1.18.0 - with: - payload: | - { - "text": "next.openbroadcast.ch - deploying ${{ steps.vars.outputs.sha_short }}" - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK