Merge pull request #305 from vivliostyle/update-vivliostyle #233
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ |