This repository was archived by the owner on Jun 30, 2025. It is now read-only.
generated from skills/deploy-to-azure
-
Notifications
You must be signed in to change notification settings - Fork 0
Provision dynamic Azure Web App #14
Open
msalsouri
wants to merge
3
commits into
main
Choose a base branch
from
create-dynamic-webapp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or 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
Comment on lines
+17
to
+40
name: 🛠 Build Frontend | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 16 | ||
- name: npm install and build webpack | ||
|
||
- name: Install & Build Webpack | ||
run: | | ||
npm install | ||
npm ci | ||
npm run build | ||
- uses: actions/upload-artifact@v4 | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: webpack artifacts | ||
name: webpack-artifacts | ||
path: public/ | ||
|
||
Build-Docker-Image: | ||
docker_build: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Actions Job or Workflow does not set permissions
Comment on lines
41
to
78
name: 🐳 Build & Push Docker Image | ||
runs-on: ubuntu-latest | ||
needs: build | ||
name: Build image and store in GitHub Container Registry | ||
|
||
steps: | ||
- name: Checkout | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download built artifact | ||
- name: Download Webpack Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: webpack artifacts | ||
name: webpack-artifacts | ||
path: public | ||
|
||
- name: Log in to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.IMAGE_REGISTRY_URL }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.CR_PAT }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
- name: Extract Metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{env.IMAGE_REGISTRY_URL}}/${{ github.repository }}/${{env.DOCKER_IMAGE_NAME}} | ||
images: ${{ env.IMAGE_REGISTRY_URL }}/${{ github.repository }}/${{ env.DOCKER_IMAGE_NAME }} | ||
tags: | | ||
type=sha,format=long,prefix= | ||
|
||
- name: Build and push Docker image | ||
- name: Build & Push Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
Deploy-to-Azure: | ||
deploy: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Actions Job or Workflow does not set permissions
Comment on lines
+16
to
+40
name: Build front-end assets | ||
runs-on: ubuntu-latest | ||
if: contains(github.event.pull_request.labels.*.name, 'deploy-staging') | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 16 | ||
- name: npm install and build webpack | ||
|
||
- name: Install dependencies and build | ||
run: | | ||
npm install | ||
npm ci | ||
npm run build | ||
- uses: actions/upload-artifact@v4 | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: webpack artifacts | ||
name: webpack-artifacts | ||
path: public/ | ||
|
||
Build-Docker-Image: | ||
docker_build: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Actions Job or Workflow does not set permissions
Comment on lines
41
to
78
name: Build and push Docker image to GHCR | ||
runs-on: ubuntu-latest | ||
needs: build | ||
name: Build image and store in GitHub Container Registry | ||
|
||
steps: | ||
- name: Checkout | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download built artifact | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: webpack artifacts | ||
name: webpack-artifacts | ||
path: public | ||
|
||
- name: Log in to GHCR | ||
- name: Log in to GitHub Container Registry (GHCR) | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.IMAGE_REGISTRY_URL }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.CR_PAT }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
- name: Generate Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{env.IMAGE_REGISTRY_URL}}/${{ github.repository }}/${{env.DOCKER_IMAGE_NAME}} | ||
images: ${{ env.IMAGE_REGISTRY_URL }}/${{ github.repository }}/${{ env.DOCKER_IMAGE_NAME }} | ||
tags: | | ||
type=sha,format=long,prefix= | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
Deploy-to-Azure: | ||
deploy: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Actions Job or Workflow does not set permissions
Comment on lines
+67
to
+84
name: 🧨 Destroy Azure Environment | ||
runs-on: ubuntu-latest | ||
|
||
if: contains(github.event.pull_request.labels.*.name, 'destroy environment') | ||
|
||
steps: | ||
- name: Checkout repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Azure login | ||
- name: Azure Login | ||
uses: azure/login@v2 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Destroy Azure environment | ||
if: success() | ||
- name: Delete Resource Group | ||
run: | | ||
az group delete --name ${{env.AZURE_RESOURCE_GROUP}} --subscription ${{secrets.AZURE_SUBSCRIPTION_ID}} --yes | ||
az group delete \ | ||
--name "${{ env.AZURE_RESOURCE_GROUP }}" \ | ||
--subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}" \ | ||
--yes |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Actions Job or Workflow does not set permissions
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Creating the dynamic webapp using naming convention: msalsouri-skills-deploy-to-azure-app