mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
8414f90a6f
See associated pull request for more information.
57 lines
2.3 KiB
YAML
57 lines
2.3 KiB
YAML
# This workflow runs whenever the ADEV build workflow has completed. Deployment happens
|
|
# as part of a dedicated second workflow to avoid security issues where the building would
|
|
# otherwise occur in an authorized context where secrets could be leaked.
|
|
#
|
|
# More details can be found here:
|
|
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/.
|
|
|
|
name: Deploying adev preview to Firebase
|
|
|
|
on:
|
|
# zizmor: ignore[dangerous-triggers] - {Trigger is safe as workflow does not checkout untrusted code}
|
|
workflow_run:
|
|
workflows: ['Build adev for preview deployment']
|
|
types: [completed]
|
|
|
|
permissions:
|
|
# Needed in order to be able to comment on the pull request.
|
|
pull-requests: write
|
|
# Needed in order to checkout the repository
|
|
contents: read
|
|
# Needed in order to retrieve the artifacts from the previous job
|
|
actions: read
|
|
|
|
env:
|
|
PREVIEW_PROJECT: ng-dev-previews
|
|
PREVIEW_SITE: ng-dev-previews-fw
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
with:
|
|
token: '${{secrets.GITHUB_TOKEN}}'
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
package-manager-cache: false
|
|
- name: Configure Firebase deploy target
|
|
working-directory: ./
|
|
run: |
|
|
# We can use `npx` as the Firebase deploy actions uses it too.
|
|
# Use stable version release
|
|
npx -y firebase-tools@15.15.0 target:clear --config adev/firebase.json --project ${{env.PREVIEW_PROJECT}} hosting angular-docs
|
|
npx -y firebase-tools@15.15.0 target:apply --config adev/firebase.json --project ${{env.PREVIEW_PROJECT}} hosting angular-docs ${{env.PREVIEW_SITE}}
|
|
|
|
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@183403ae13b785698eaf13c819dda55b9fed430b # main
|
|
with:
|
|
github-token: '${{secrets.GITHUB_TOKEN}}'
|
|
workflow-artifact-name: 'adev-preview'
|
|
firebase-config-dir: './adev'
|
|
firebase-public-dir: './adev/build/browser'
|
|
firebase-project-id: '${{env.PREVIEW_PROJECT}}'
|
|
firebase-service-key: '${{secrets.FIREBASE_PREVIEW_SERVICE_TOKEN}}'
|