refactor: 🔧 adding api-url env var support #34
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 | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
id-token: write | |
contents: read | |
actions: read | |
jobs: | |
build_and_deploy_components: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
runs-on: ubuntu-latest | |
name: Build and Deploy Components | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/setup-kubectl@v4 | |
- uses: Azure/k8s-set-context@v4 | |
with: | |
kubeconfig: ${{ secrets.KUBE_CONFIG }} | |
- run: | | |
kubectl apply -f deploy/cosmosdb-statestore.yaml | |
kubectl apply -f deploy/pubsub.yaml | |
kubectl apply -f deploy/secret-store.yaml | |
build_and_deploy_order_management_service: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
runs-on: ubuntu-latest | |
name: Build and Deploy Order Management | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Azure/docker-login@v1 | |
with: | |
login-server: ${{ secrets.ACR_LOGIN_SERVER }} | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASS }} | |
- run: | | |
docker build ./order-management -t daprcafe.azurecr.io/order-management:new | |
docker push daprcafe.azurecr.io/order-management:new | |
- uses: azure/setup-kubectl@v4 | |
- uses: Azure/k8s-set-context@v4 | |
with: | |
kubeconfig: ${{ secrets.KUBE_CONFIG }} | |
- run: | | |
kubectl apply -f deploy/deployment.yaml | |
kubectl apply -f deploy/service.yaml | |
build_and_deploy_order_processor_service: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
runs-on: ubuntu-latest | |
name: Build and Deploy Order Processor | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Azure/docker-login@v1 | |
with: | |
login-server: ${{ secrets.ACR_LOGIN_SERVER }} | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASS }} | |
- run: | | |
docker build ./order-processor -t daprcafe.azurecr.io/order-processor:latest | |
docker push daprcafe.azurecr.io/order-processor:latest | |
- uses: azure/setup-kubectl@v4 | |
- uses: Azure/k8s-set-context@v4 | |
with: | |
kubeconfig: ${{ secrets.KUBE_CONFIG }} | |
- run: | | |
kubectl apply -f deploy/deployment.yaml | |
build_and_deploy_frontend: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
runs-on: ubuntu-latest | |
name: Build and Deploy Frontend | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
lfs: false | |
- name: Build And Deploy | |
id: builddeploy | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ORANGE_TREE_098987F0F }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
action: "upload" | |
app_location: "/frontend/" | |
api_location: "" | |
output_location: "build" | |
app_build_command: 'npm run build' | |
env: | |
API_URL: ${{ secrets.API_URL }} | |