Merge branch 'contest-announce' into stg #72
Workflow file for this run
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 to GAE | |
on: | |
push: | |
branches: | |
- "stg" | |
- "release" | |
jobs: | |
auto_deploy_gae: | |
permissions: write-all | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 10 | |
steps: | |
- name: Setup Node.js 18 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
- uses: actions/checkout@v2 | |
- name: "Extract branch name" | |
id: branch-name | |
shell: bash | |
run: | | |
short_ref=${GITHUB_REF#refs/*/} | |
formatted_ref=$(echo "$short_ref" | tr '[:upper:]' '[:lower:]' | tr '/' '-') | |
echo "short_ref=${formatted_ref}" >> $GITHUB_ENV | |
- name: configure service name | |
run: | | |
if [[ "${{ env.short_ref }}" == "release" ]]; then | |
sed -i 's/{{service_name}}/tokiwa23/' app.yaml | |
echo "BASE_URL=/23/tokiwa/" >> .env | |
echo "IS_PRODUCTION=true" >> .env | |
elif [[ "${{ env.short_ref }}" == "stg" ]]; then | |
sed -i 's/{{service_name}}/tokiwa23-stg/' app.yaml | |
echo "BASE_URL=/stg/23/tokiwa/" >> .env | |
echo "IS_PRODUCTION=false" >> .env | |
fi | |
echo "CONTEST_DATA_URL=${{ secrets.CONTEST_DATA_URL }}" >> .env | |
# switch service name to configure deployment target appropriately | |
- name: Download events.json from external URL | |
run: | | |
curl "${{ secrets.EVENTS_COMPLETE_URL }}" -o ./assets/data/events-detail.json | |
curl "${{ secrets.EVENTS_SUMMARY_URL }}" -o ./assets/data/events.json | |
- name: yarn install | |
run: yarn install | |
- name: yarn build | |
run: yarn build | |
- id: "auth" | |
uses: "google-github-actions/auth@v0" | |
with: | |
credentials_json: "${{ secrets.GCP_SA_KEY }}" | |
- name: "Deploy to App Engine" | |
id: "deploy" | |
uses: "google-github-actions/deploy-appengine@v0" | |
with: | |
deliverables: "app.yaml" | |
promote: true |