🛠️ .github/workflows/frontend.main.yml -> Added workflow path for Git… #15
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_frontend | |
# Deploys when pish is made from the frontend folder | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- 'frontend/**' | |
- '.github/workflows/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Upload to blob storage | |
uses: azure/CLI@v1 | |
with: | |
inlineScript: | | |
az storage blob upload-batch --account-name drewdavisresume --auth-mode key -d '$web' -s frontend/ --overwrite | |
- name: Purge CDN endpoint | |
uses: azure/CLI@v1 | |
with: | |
inlineScript: | | |
az cdn endpoint purge --content-paths "/*" --profile-name "drewdavisresume" --name "drewdavisresume" --resource-group "azureresume-rg" | |
# Azure logout | |
- name: logout | |
run: | | |
az logout | |
if: always() |