Skip to content

dodadeno tekst #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/ReactAppWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: ReactAppWorkflow
"on":
push:
branches:
- master
workflow_dispatch: {}
env:
ACR_RESOURCE_GROUP: AKSrg
AZURE_CONTAINER_REGISTRY: AKSregistar
CLUSTER_NAME: AKSclusterCICD
CLUSTER_RESOURCE_GROUP: AKSrg
CONTAINER_NAME: mypdfsample
DEPLOYMENT_MANIFEST_PATH: |
./docker-compose.yml
jobs:
buildImage:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: azure/login@v1.4.3
name: Azure login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
- name: Build and push image to ACR
run: az acr build --image ${{ env.CONTAINER_NAME }}:${{ github.sha }} --registry ${{ env.AZURE_CONTAINER_REGISTRY }} -g ${{ env.ACR_RESOURCE_GROUP }} -f ./Dockerfile ./
deploy:
permissions:
actions: read
contents: read
id-token: write
runs-on: ubuntu-latest
needs:
- buildImage
steps:
- uses: actions/checkout@v3
- uses: azure/login@v1.4.3
name: Azure login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
- uses: azure/aks-set-context@v3
name: Get K8s context
with:
cluster-name: ${{ env.CLUSTER_NAME }}
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
- uses: Azure/k8s-deploy@v4
name: Deploys application
with:
action: deploy
images: ${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }}
manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }}
namespace: namespace-workflow-1663333883688
51 changes: 51 additions & 0 deletions .github/workflows/master_reactaplikacija.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy container app to Azure Web App - reactaplikacija

on:
push:
branches:
- master
workflow_dispatch:

jobs:
build:
runs-on: 'ubuntu-latest'

steps:
- uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to registry
uses: docker/login-action@v1
with:
registry: https://acrreactapp.azurecr.io/
username: ${{ secrets.AzureAppService_ContainerUsername_79a092e655204a13bed2db21a644bb06 }}
password: ${{ secrets.AzureAppService_ContainerPassword_aa90a770b7be408eb64e80791df62749 }}

- name: Build and push container image to registry
uses: docker/build-push-action@v2
with:
push: true
tags: acrreactapp.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_79a092e655204a13bed2db21a644bb06 }}/reactwebapp:${{ github.sha }}
file: ./Dockerfile

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'reactaplikacija'
slot-name: 'production'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_62132923a03c4bd78e08b92317fcea26 }}
images: 'acrreactapp.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_79a092e655204a13bed2db21a644bb06 }}/reactwebapp:${{ github.sha }}'
3 changes: 2 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ function App() {
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>Bye there!</p>
<p>Bye there! by AleksandarPanchevski ke uspeam...
</p>
<a
className="App-link"
href="https://reactjs.org"
Expand Down