icon updates #72
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 Agent Squire | |
on: | |
push: | |
branches: | |
- main | |
env: | |
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' | |
CARGO_TERM_COLOR: always | |
ACCOUNT_NAME: agentsquire | |
PROFILE_NAME: agentsquireprofile | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Target | |
run: rustup target add wasm32-unknown-unknown | |
- name: Build | |
run: cargo build | |
- name: Run Tests | |
run: cargo test | |
- name: Install Trunk | |
run: cargo install trunk | |
- name: Install Post Build | |
run: cargo install webapp_post_build --git https://github.com/StoicDreams/WebUI | |
- name: Build Web App | |
run: | | |
# Change directory to project folder | |
cd webapp | |
# Build | |
trunk build --release | |
- name: Azure Login | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
# - name: Remove Old Files | |
# uses: azure/CLI@v1 | |
# with: | |
# inlineScript: | | |
# az storage blob delete-batch -s '$web' --account-name ${{ env.ACCOUNT_NAME }} | |
- name: Copy Files to Azure Blob Storage | |
uses: azure/CLI@v1 | |
with: | |
inlineScript: | | |
az storage copy -s 'webapp/dist/*' --destination-account-name ${{ env.ACCOUNT_NAME }} --destination-container '$web' --recursive | |
- name: logout | |
run: | | |
az logout | |
if: always() | |
purge-storage-cache: | |
runs-on: ubuntu-latest | |
needs: build-and-deploy | |
steps: | |
- name: Azure Login | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Purge Storage Cache | |
uses: azure/CLI@v1 | |
with: | |
inlineScript: | | |
az cdn endpoint purge -g ${{ secrets.AZURE_RESOURCE_GROUP }} -n ${{ env.ACCOUNT_NAME }} --profile-name ${{ env.PROFILE_NAME }} --content-paths '/*' | |
- name: logout | |
run: | | |
az logout | |
if: always() |