diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 7f9a753f..b88235cc 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -161,7 +161,17 @@ jobs: service-account-key: ${{ secrets.GCLOUD_AUTH }} - name: Deploy to Cloud Run - uses: extenda/actions/cloud-run@v0 - with: - service-account-key: ${{ secrets.GCLOUD_AUTH }} - image: ${{ needs.release.outputs.docker-image-name }} + run: | + gcloud run deploy tech-radar \ + --image=${{ needs.release.outputs.docker-image-name }} \ + --service-account=cloudrun-runtime@${{ steps.gcloud.outputs.project-id }}.iam.gserviceaccount.com \ + --platform=managed \ + --region=europe-west1 \ + --project=${{ steps.gcloud.outputs.project-id }} \ + --cpu=1 \ + --memory=256Mi \ + --min-instances=0 \ + --max-instances=20 \ + --allow-unauthenticated \ + --set-env-vars=SERVICE_PROJECT_ID=${{ steps.gcloud.outputs.project-id }},SERVICE_ENVIRONMENT=prod \ + --set-secrets=LD_SDK_KEY=launchdarkly-sdk-key:latest diff --git a/Dockerfile b/Dockerfile index 22e57d28..3a2eface 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,8 @@ ENV PUBLIC_HTML /var/www EXPOSE 8080 -COPY --from=gcr.io/berglas/berglas:0.5.2 /bin/berglas /bin/berglas - COPY build /var/www COPY server/dist /opt/tech-radar -COPY entrypoint.sh /usr/local/bin/entrypoint.sh -CMD ["/usr/local/bin/entrypoint.sh"] +ENTRYPOINT ["/usr/local/bin/node"] +CMD ["/opt/tech-radar/index.js"] diff --git a/cloud-run.yaml b/cloud-run.yaml deleted file mode 100644 index 4ea6960d..00000000 --- a/cloud-run.yaml +++ /dev/null @@ -1,10 +0,0 @@ -name: tech-radar -cpu: 1 -memory: 256Mi -environment: - USE_BERGLAS: 'true' - LD_SDK_KEY: sm://*/launchdarkly-sdk-key -platform: - managed: - allow-unauthenticated: true - region: europe-west1 diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index eb3bdd16..00000000 --- a/entrypoint.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env sh - -if [ "$USE_BERGLAS" = "true" ]; then - exec /bin/berglas exec -- /usr/local/bin/node /opt/tech-radar/index.js -else - exec /usr/local/bin/node /opt/tech-radar/index.js -fi