Skip to content

Instantly share code, notes, and snippets.

@Shaxadhere
Created March 4, 2024 12:36
Show Gist options
  • Save Shaxadhere/7681937a82527386722bad775919cf23 to your computer and use it in GitHub Desktop.
Save Shaxadhere/7681937a82527386722bad775919cf23 to your computer and use it in GitHub Desktop.
image: node:18
pipelines:
branches:
release/prod:
- step:
deployment: production
name: Build and Deploy to Azure Blob Storage
caches:
- node
script:
# Install dependencies and build your static website
- npm install && CI=false
- npm run build
# Authenticate with Azure using Azure CLI
- apt-get update && apt-get install -y azure-cli
- az login --service-principal --username $AZURE_CLIENT_ID --password $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID
# Set Azure subscription
- az account set --subscription $AZURE_SUBSCRIPTION_ID
# Upload static website files to Azure Blob Storage
- az storage blob sync --container '$web' --account-name $AZURE_STORAGE_ACCOUNT_NAME --account-key $AZURE_STORAGE_ACCOUNT_KEY --source './build'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment