From 68900384cab7aa60742988b33128abea582d4479 Mon Sep 17 00:00:00 2001 From: Michael Buchoff Date: Sat, 9 Sep 2023 17:28:35 -0400 Subject: [PATCH 1/6] Added azure_webapp.yml --- .github/workflows/azure_webapp.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/azure_webapp.yml diff --git a/.github/workflows/azure_webapp.yml b/.github/workflows/azure_webapp.yml new file mode 100644 index 0000000..dbc2e3a --- /dev/null +++ b/.github/workflows/azure_webapp.yml @@ -0,0 +1,24 @@ +name: Linux Container Node Workflow + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: azure/docker-login@v1 + with: + login-server: mycontainer.azurecr.io + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - run: | + docker build . -t mycontainer.azurecr.io/myapp:${{ github.sha }} + docker push mycontainer.azurecr.io/myapp:${{ github.sha }} + + - uses: azure/webapps-deploy@v2 + with: + app-name: 'myapp' + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + images: 'mycontainer.azurecr.io/myapp:${{ github.sha }}' \ No newline at end of file From 0bc895c2e8d25e2f01d4d6beb3671fa422d759a4 Mon Sep 17 00:00:00 2001 From: Michael Buchoff Date: Sat, 9 Sep 2023 17:32:07 -0400 Subject: [PATCH 2/6] Corrected the name of docker registry --- .github/workflows/azure_webapp.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/azure_webapp.yml b/.github/workflows/azure_webapp.yml index dbc2e3a..9394212 100644 --- a/.github/workflows/azure_webapp.yml +++ b/.github/workflows/azure_webapp.yml @@ -14,11 +14,11 @@ jobs: username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - run: | - docker build . -t mycontainer.azurecr.io/myapp:${{ github.sha }} - docker push mycontainer.azurecr.io/myapp:${{ github.sha }} + docker build . -t mbuchoff/hackathon_230909:${{ github.sha }} + docker push mbuchoff/hackathon_230909:${{ github.sha }} - uses: azure/webapps-deploy@v2 with: app-name: 'myapp' publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - images: 'mycontainer.azurecr.io/myapp:${{ github.sha }}' \ No newline at end of file + images: 'mbuchoff/hackathon_230909:${{ github.sha }}' \ No newline at end of file From 140407381718c37e8abf24568d9f99a42a8d42d1 Mon Sep 17 00:00:00 2001 From: Michael Buchoff Date: Sat, 9 Sep 2023 17:40:31 -0400 Subject: [PATCH 3/6] Commented out login server, hoping it defaults to docker --- .github/workflows/azure_webapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure_webapp.yml b/.github/workflows/azure_webapp.yml index 9394212..3c348da 100644 --- a/.github/workflows/azure_webapp.yml +++ b/.github/workflows/azure_webapp.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v2 - uses: azure/docker-login@v1 with: - login-server: mycontainer.azurecr.io +# login-server: mycontainer.azurecr.io username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - run: | From a50d97550a28019e263f82d8e05b175e0f519e06 Mon Sep 17 00:00:00 2001 From: Michael Buchoff Date: Sat, 9 Sep 2023 17:41:00 -0400 Subject: [PATCH 4/6] Changed name of workflow --- .github/workflows/azure_webapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure_webapp.yml b/.github/workflows/azure_webapp.yml index 3c348da..e98e713 100644 --- a/.github/workflows/azure_webapp.yml +++ b/.github/workflows/azure_webapp.yml @@ -1,4 +1,4 @@ -name: Linux Container Node Workflow +name: Azure Webapp deploy on: [push] From d72420977f1dc8b570f9ae6cea4026bd5cbf242b Mon Sep 17 00:00:00 2001 From: Michael Buchoff Date: Sat, 9 Sep 2023 17:42:43 -0400 Subject: [PATCH 5/6] Corrected webapp name --- .github/workflows/azure_webapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure_webapp.yml b/.github/workflows/azure_webapp.yml index e98e713..59b4ab2 100644 --- a/.github/workflows/azure_webapp.yml +++ b/.github/workflows/azure_webapp.yml @@ -19,6 +19,6 @@ jobs: - uses: azure/webapps-deploy@v2 with: - app-name: 'myapp' + app-name: 'app-hackathon' publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} images: 'mbuchoff/hackathon_230909:${{ github.sha }}' \ No newline at end of file From 553a3302750f6762fe559af9b0681a346d55aff2 Mon Sep 17 00:00:00 2001 From: Michael Buchoff Date: Sat, 9 Sep 2023 18:01:38 -0400 Subject: [PATCH 6/6] Deploys to webapps on pushes or PRs to develop --- .github/workflows/azure_webapp.yml | 2 +- .github/workflows/ci-cd.yml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/azure_webapp.yml b/.github/workflows/azure_webapp.yml index 59b4ab2..a9c02b6 100644 --- a/.github/workflows/azure_webapp.yml +++ b/.github/workflows/azure_webapp.yml @@ -1,6 +1,6 @@ name: Azure Webapp deploy -on: [push] +on: workflow_dispatch jobs: build: diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 18e6de8..7d7bf32 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -1,11 +1,9 @@ name: Build, Test and Deploy backend on: - # opening a pull request to master and develop branch will be a trigger pull_request: branches: - develop - # any code pushed to master and develop branch will also be a trigger push: branches: - develop