Add required secrets #1
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
on: | ||
workflow_call: | ||
inputs: | ||
build_site: | ||
description: 'When true, the static web app will be regeneratetd' | ||
type: boolean | ||
required: true | ||
build_timeout_mins: | ||
description: 'The maximum time to allow for the build to complete' | ||
type: number | ||
default: 5 | ||
deployment_client_id: | ||
description: 'The Client ID for the deployment service principal' | ||
type: string | ||
required: true | ||
deployment_subscription_id: | ||
description: 'The Subscription ID for the deployment service principal' | ||
type: string | ||
required: true | ||
deployment_tenant_id: | ||
description: 'The Tenant ID for the deployment service principal' | ||
type: string | ||
required: true | ||
deploy_site: | ||
description: 'When true, the static web app will be deployed' | ||
type: boolean | ||
required: true | ||
deploy_timeout_mins: | ||
description: 'The maximum time to allow for the deployment to complete' | ||
type: number | ||
default: 6 | ||
environment: | ||
description: 'The environment to deploy to' | ||
type: string | ||
required: true | ||
export_storage_account: | ||
description: 'The storage account where the export file will be published' | ||
type: string | ||
default: '' | ||
export_storage_container: | ||
description: 'The storage container where the export file will be published' | ||
type: string | ||
default: '' | ||
export_storage_blob_path: | ||
description: 'The blob path where the export file will be published' | ||
type: string | ||
default: '' | ||
force_export: | ||
description: 'When true, the export file will be published to specified storage account regardless of which branch, otherwise only the main branch will be published' | ||
type: boolean | ||
default: false | ||
website_name: | ||
description: 'The name of the static web app' | ||
type: string | ||
required: true | ||
website_resource_group: | ||
description: 'The resource group for the static web app' | ||
type: string | ||
required: true | ||
secrets: | ||
ENDJIN_GITHUB_READER_PAT: | ||
description: 'The Personal Access Token for the GitHub reader account' | ||
required: true | ||
GITHUB_TOKEN: | ||
Check failure on line 64 in .github/workflows/vellum-static-web-app-pipeline.yml GitHub Actions / .github/workflows/vellum-static-web-app-pipeline.ymlInvalid workflow file
|
||
description: 'The GitHub Token' | ||
required: true | ||
SWA_API_TOKEN: | ||
description: 'The API Token for the Static Web App' | ||
required: true | ||
permissions: | ||
id-token: write | ||
contents: read | ||
pull-requests: write | ||
actions: write | ||
env: | ||
VELLUM_CULTURE: en-GB | ||
jobs: | ||
build: | ||
if: inputs.build_site == true | ||
runs-on: ubuntu-latest | ||
timeout-minutes: ${{ inputs.build_timeout_mins }} | ||
name: Build Web Site | ||
steps: | ||
- uses: endjin/Endjin.RecommendedPractices.GitHubActions/actions/vellum-site-build@main | ||
id: build | ||
with: | ||
githubVellumPat: ${{ secrets.ENDJIN_GITHUB_READER_PAT }} | ||
env: | ||
BUILDVAR_PublishExportFile: ${{ (inputs.force_export || github.ref == 'refs/heads/main') && 'True' || 'False' }} | ||
BUILDVAR_ExportPublishStorageAccountName: ${{ inputs.export_storage_account }} | ||
BUILDVAR_ExportPublishStorageContainerName: ${{ inputs.export_storage_container }} | ||
BUILDVAR_ExportPublishStorageBlobPath: ${{ inputs.export_storage_blob_path }} | ||
deploy: | ||
if: inputs.deploy_site == true | ||
runs-on: ubuntu-latest | ||
timeout-minutes: ${{ inputs.deploy_timeout_mins }} | ||
name: Deploy Web Site | ||
needs: build | ||
environment: ${{ inputs.environment }} | ||
steps: | ||
- uses: endjin/Endjin.RecommendedPractices.GitHubActions/actions/vellum-site-deploy@main | ||
id: deploy | ||
with: | ||
azureClientId: ${{ inputs.deployment_client_id }} | ||
azureTenantId: ${{ inputs.deployment_tenant_id }} | ||
azureSubscriptionId: ${{ inputs.deployment_subscription_id }} | ||
githubToken: ${{ secrets.GITHUB_TOKEN}} | ||
swaApiToken: ${{ secrets.SWA_PROD }} | ||
swaResourceGroupName: ${{ inputs.website_resource_group }} | ||
swaSiteName: ${{ inputs.website_name }} | ||
# close_pull_request_job: | ||
# if: github.event_name == 'pull_request' && github.event.action == 'closed' | ||
# runs-on: ubuntu-latest | ||
# name: Close Pull Request | ||
# environment: ${{ inputs.environment }} | ||
# steps: | ||
# - name: Close Pull Request | ||
# id: closepullrequest | ||
# uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9 # v 1.0.0 | ||
# with: | ||
# azure_static_web_apps_api_token: ${{ secrets.SWA_API_TOKEN }} | ||
# action: "close" | ||
# app_location: website |