Merge pull request #641 from pixiv/icons/update/1729473942250 #221
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 Live Channel | |
on: | |
push: | |
branches: | |
- main | |
env: | |
WORKLOAD_IDENTITY_PROVIDER: 'projects/643536859873/locations/global/workloadIdentityPools/charcoal/providers/github-actions' | |
SERVICE_ACCOUNT_EMAIL: '[email protected]' | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
deploy_live_website: | |
runs-on: ubuntu-latest | |
concurrency: live-channel | |
environment: | |
name: live-channel | |
# url: TODO: Edit after | |
steps: | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.node-version' | |
cache: yarn | |
# charcoal packages | |
- run: yarn install --immutable | |
- run: yarn build | |
# docs | |
- run: yarn storybook:build | |
- id: auth | |
uses: google-github-actions/auth@v1 | |
with: | |
workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ env.SERVICE_ACCOUNT_EMAIL }} | |
create_credentials_file: true | |
- name: GCP Authenticate | |
uses: google-github-actions/setup-gcloud@v1 | |
# c.f. https://github.com/FirebaseExtended/action-hosting-deploy/issues/174#issuecomment-1312272238 | |
- name: Pass the path to the Service Account file automatically generated by google-github-actions/auth | |
run: | | |
echo "SERVICE_ACCOUNT_KEY=$(cat "${{ steps.auth.outputs.credentials_file_path }}" | tr -d '\n')" >> $GITHUB_ENV | |
- uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
projectId: pixiv-charcoal-web | |
channelId: live | |
firebaseServiceAccount: ${{ env.SERVICE_ACCOUNT_KEY }} |