diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cd792a4..81bce426 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,10 +9,6 @@ on: branches: - master -# Environment variables available to all jobs and steps in this workflow -env: - GITHUB_SHA: ${{ github.sha }} - jobs: run-test: name: Test diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a64b6ac9..eb4a8e22 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,88 +7,35 @@ on: branches: - master -# Environment variables available to all jobs and steps in this workflow -env: - GKE_PROJECT_ID: ${{ secrets.GKE_PROJECT_ID }} - GKE_EMAIL: ${{ secrets.GKE_EMAIL }} - CLOUD_SQL_SERVICE_ACCOUNT: ${{ secrets.CLOUD_SQL_SERVICE_ACCOUNT }} - CLOUD_STORE_SERVICE_ACCOUNT: ${{ secrets.CLOUD_STORE_SERVICE_ACCOUNT }} - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - GITHUB_SHA: ${{ github.sha }} - GKE_ZONE: europe-west4-b - GKE_CLUSTER: prod - REGISTRY_HOSTNAME: eu.gcr.io - jobs: setup-build-publish-deploy: name: Deploy runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 - - name: Checkout - uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2.1.0 + with: + node-version: '14' - # begin caching - - name: Get yarn cache directory path - id: yarn-cache-dir-path + - name: Get yarn cache + id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + - name: Cache dependencies + uses: actions/cache@v2 with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - # end caching - - # Setup gcloud CLI - - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master - with: - version: '270.0.0' - service_account_email: ${{ secrets.GKE_EMAIL }} - service_account_key: ${{ secrets.GKE_KEY }} - project_id: ${{ secrets.GKE_PROJECT_ID }} - - uses: actions/setup-java@v1.3.0 - with: - java-version: 1.11 - - # Configure docker to use the gcloud command-line tool as a credential helper - - run: | - # Set up docker to authenticate - # via gcloud command-line tool. - gcloud auth configure-docker - # Build and push image to Google Container Registry - - name: Build - run: |- - gradle jib - - # Deploy the Docker image to the GKE cluster - - name: Prepare Helm - uses: azure/setup-helm@v1 - with: - version: v3.1.2 + - run: yarn install --frozen-lockfile + - run: yarn build - name: Deploy - run: | - gcloud container clusters get-credentials "$GKE_CLUSTER" --zone "$GKE_ZONE" --project "$GKE_PROJECT_ID" - echo -n "${CLOUD_SQL_SERVICE_ACCOUNT}" > chart/cloudsql.base64.json - echo -n "${CLOUD_STORE_SERVICE_ACCOUNT}" > chart/cloudstore.base64.json - helm repo add stable "https://kubernetes-charts.storage.googleapis.com" - helm upgrade --install traefik stable/traefik -f chart/traefik.values.yaml - - values="" - target="${GITHUB_REF//refs\/heads\//}" - if [[ "$GITHUB_EVENT_NAME" == "release" ]]; then - target="production" - elif [[ -f "chart/values.${target}.yml" ]]; then - values="-f chart/values.${target}.yml" - else - echo "unkown target ${target}" - exit 42 - fi - - helm upgrade --install "imis-${target}" chart $values \ - --set gitSha=${GITHUB_SHA} --set "secrets.postgres=$(echo -n ${POSTGRES_PASSWORD} | base64)" - kubectl rollout status "deployment/imis-${target}" \ No newline at end of file + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist \ No newline at end of file diff --git a/.gitignore b/.gitignore index d7a5cf3d..99b4fc36 100644 --- a/.gitignore +++ b/.gitignore @@ -8,12 +8,6 @@ client/.vscode .vscode **/.project **/.settings -/.classpath -# CMake -cmake-build-*/ - -# TODO -#client/src/store/ImisSwaggerApi.ts # File-based project format *.iws @@ -33,10 +27,6 @@ crashlytics.properties crashlytics-build.properties fabric.properties -### Java ### -# Compiled class file -*.class - # Log file *.log @@ -48,7 +38,6 @@ fabric.properties # Package Files # *.jar -!gradle/wrapper/gradle-wrapper.jar *.war *.nar *.ear @@ -66,13 +55,9 @@ hs_err_pid* ### Node node_modules -client/dist -# we use client/yarn.lock instead! -client/package-lock.json +dist # Log files -client/npm-debug.log* -client/yarn-debug.log* -client/yarn-error.log* -/build/ -/venv/ +npm-debug.log* +yarn-debug.log* +yarn-error.log*