From 23f7e81147753b40dac98563975b798a9974ffd4 Mon Sep 17 00:00:00 2001 From: GozCode <40898932+cgonzalezdev@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:59:55 -0500 Subject: [PATCH 1/2] Create create-deploy.yml Deployment initial --- .github/workflows/create-deploy.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/create-deploy.yml diff --git a/.github/workflows/create-deploy.yml b/.github/workflows/create-deploy.yml new file mode 100644 index 0000000..8e2e026 --- /dev/null +++ b/.github/workflows/create-deploy.yml @@ -0,0 +1,24 @@ +name: Create Azure resources +on: [workflow_dispatch] +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + + # Checkout codes + - uses: actions/checkout@main + + # Log into Azure + - uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + # Deploy Bicep file + - name: create resources + uses: azure/arm-deploy@v1 + with: + subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} + resourceGroupName: ${{ vars.AZURE_RG }} + template: ${{ github.workspace }}/config/main.bicep + parameters: 'namePrefix=${{ vars.AZURE_PREFIX }}' + failOnStdErr: false From 40dd17c59cde3886b6420c8c152aa72799c9724a Mon Sep 17 00:00:00 2001 From: GozCode <40898932+cgonzalezdev@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:39:38 -0500 Subject: [PATCH 2/2] Create Azure Deploy --- .github/workflows/azure-deploy.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/azure-deploy.yml diff --git a/.github/workflows/azure-deploy.yml b/.github/workflows/azure-deploy.yml new file mode 100644 index 0000000..b43f661 --- /dev/null +++ b/.github/workflows/azure-deploy.yml @@ -0,0 +1,25 @@ + name: Deploy to Azure + on: + push: + branches: + - main + + jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Log in to Azure + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: Build and deploy Container App + uses: azure/container-apps-deploy-action@v1 + with: + appSourcePath: ${{ github.workspace }} + acrName: ${{ vars.AZURE_PREFIX }}acr + resourceGroup: ${{ vars.AZURE_RG }} + containerAppName: ${{ vars.AZURE_PREFIX }}containerapp