more tweaks #158
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 Azure Blob Storage | |
on: | |
push: | |
branches: | |
- main # or your default branch name | |
paths-ignore: | |
- 'workers/**' # Ignore changes in the workers directory | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
env: | |
ACTIONS_NODE_DEFAULT_VERSION: '16.x' | |
ACTIONS_RUNNER_DEBUG: 'true' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: npm install --legacy-peer-deps | |
- name: Build React App | |
run: npm run build | |
- name: Login to Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Deploy to Azure Blob Storage | |
run: | | |
az storage blob upload-batch --account-name "pitrewebpagestorage" -s build -d '$web' --overwrite | |
- name: Purge CDN cache | |
run: | | |
az cdn endpoint purge --resource-group PitreWebpageResourceGroup --profile-name PitreWebpageCDNProfile --name pitreinfo --content-paths '/*' | |
env: | |
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} |