Skip to content

Merge pull request #293 from vivliostyle/chore/update-deps-eslint-and… #228

Merge pull request #293 from vivliostyle/chore/update-deps-eslint-and…

Merge pull request #293 from vivliostyle/chore/update-deps-eslint-and… #228

name: Delivery Containers
on:
push:
branches:
- master
env:
GCP_REGION: asia-northeast1
IMAGE: asia.gcr.io/${{ secrets.GCP_PROJECT_ID }}/vivliostyle-pub-build-pdf:${{ github.sha }}
jobs:
delivery:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- id: 'auth'
uses: google-github-actions/auth@v0
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Setup GCloud
uses: google-github-actions/setup-gcloud@v0
with:
version: '318.0.0'
- name: Configure docker to use the gcloud cli
run: gcloud auth configure-docker --quiet
- name: Build a docker image
run: |
docker build cloud-run \
-t $IMAGE \
--build-arg GH_APPS_PRIVATEKEY="${{ secrets.GH_APPS_PRIVATEKEY }}" \
--build-arg GH_APPS_ID="${{ secrets.GH_APPS_ID }}"
- name: Push the docker image
run: docker push $IMAGE
- name: Deploy to Cloud Run
run: |
gcloud run deploy vivliostyle-pub-build-pdf \
--image $IMAGE \
--project ${{ secrets.GCP_PROJECT_ID }} \
--region $GCP_REGION \
--platform managed \
--timeout 15m \
--cpu 4 \
--memory 8Gi \
--concurrency 1 \
--quiet
gcloud run services update-traffic vivliostyle-pub-build-pdf --to-latest \
--region $GCP_REGION \
--platform managed \