update researches #69
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: deploy on GCP | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: deploy production cloud functions | |
strategy: | |
matrix: | |
go-version: [1.13.x] | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Module vendor | |
run: | | |
go mod vendor | |
ls -al | |
- name: Move local modules to /vendor | |
run: | | |
export MODULE_NAME=$(head -n 1 go.mod | awk -F ' ' '{print $2}') | |
mkdir -p ./vendor/$MODULE_NAME | |
mv gamedata ./vendor/$MODULE_NAME | |
mv messageTemplate ./vendor/$MODULE_NAME | |
mv utils ./vendor/$MODULE_NAME | |
- id: auth | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.GCP_CREDENTIALS }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
with: | |
project_id: pokemon-go-assistant-chatbot | |
export_default_credentials: true | |
- name: Use gcloud CLI | |
run: | | |
gcloud functions deploy webhook \ | |
--entry-point WebhookFunction \ | |
--trigger-http \ | |
--allow-unauthenticated \ | |
--region asia-east2 \ | |
--runtime go113 \ | |
--update-env-vars LINE_CHANNEL_SECRET=${{ secrets.LINE_CHANNEL_SECRET }},LINE_CHANNEL_ACCESS_TOKEN=${{ secrets.LINE_CHANNEL_ACCESS_TOKEN }},LINE_MANAGER_USER_ID=${{ secrets.LINE_MANAGER_USER_ID }},TIMEZONE_LOCATION=${{ secrets.TIMEZONE_LOCATION }} \ | |
--memory 128MB \ | |
--timeout 10 \ | |
--clear-labels |