Skip to content

Commit

Permalink
deploy on pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
fusionstrings committed Apr 4, 2021
1 parent c776b74 commit 5d0cb24
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/deploy-cloud-run-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

on: pull_request

name: Build and Deploy a Container on pull_request
env:
PROJECT_ID: ${{ secrets.GCP_PROJECT }}
SERVICE: chitrkatha-${{ github.event.number }}
REGION: europe-north1

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Cloud SDK
uses: google-github-actions/[email protected]
with:
project_id: ${{ env.PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true # Set to true to authenticate the Cloud Run action

- name: Authorize Docker push
run: gcloud auth configure-docker

- name: Build and Push Container
run: |-
echo ${{ env.SERVICE }}
docker build -t gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }} .
docker push gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}
- name: Deploy to Cloud Run
id: deploy
uses: google-github-actions/[email protected]
with:
service: ${{ env.SERVICE }}
image: gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}
region: ${{ env.REGION }}

- name: Show Output
run: echo ${{ steps.deploy.outputs.url }}

1 comment on commit 5d0cb24

@deno-deploy
Copy link

@deno-deploy deno-deploy bot commented on 5d0cb24 Apr 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to deploy:

relative import path "http/server.ts" not prefixed with / or ./ or ../ Imported from "https://raw.githubusercontent.com/fusionstrings/chitrkatha/5d0cb241758df7adcfeac46877876f1aaf5d87f6/deps.ts"

Please sign in to comment.