|
1 | | -name: Build and Deploy Prod |
2 | | -on: |
3 | | - release: |
4 | | - types: [published, edited] |
5 | | - branches: |
6 | | - - main |
| 1 | +# name: Build and Deploy Prod |
| 2 | +# on: |
| 3 | +# release: |
| 4 | +# types: [published, edited] |
| 5 | +# branches: |
| 6 | +# - main |
7 | 7 |
|
8 | | -env: |
9 | | - REGISTRY: ${{ secrets.AZURE_CONTAINER_REGISTRY }} |
10 | | - IMAGE_NAME: ${{ github.repository }} |
| 8 | +# env: |
| 9 | +# REGISTRY: ${{ secrets.AZURE_CONTAINER_REGISTRY }} |
| 10 | +# IMAGE_NAME: ${{ github.repository }} |
11 | 11 |
|
12 | | -jobs: |
13 | | - build: |
14 | | - runs-on: ubuntu-latest |
| 12 | +# jobs: |
| 13 | +# build: |
| 14 | +# runs-on: ubuntu-latest |
15 | 15 |
|
16 | | - steps: |
17 | | - - name: Checkout code |
18 | | - uses: actions/checkout@v3 |
| 16 | +# steps: |
| 17 | +# - name: Checkout code |
| 18 | +# uses: actions/checkout@v3 |
19 | 19 |
|
20 | | - - name: Set Tag |
21 | | - id: get_tag |
22 | | - run: | |
23 | | - TAG=$(echo "${{ github.ref }}" | sed -e 's/refs\/tags\///') |
24 | | - echo "TAG=$TAG" >> $GITHUB_ENV |
| 20 | +# - name: Set Tag |
| 21 | +# id: get_tag |
| 22 | +# run: | |
| 23 | +# TAG=$(echo "${{ github.ref }}" | sed -e 's/refs\/tags\///') |
| 24 | +# echo "TAG=$TAG" >> $GITHUB_ENV |
25 | 25 |
|
26 | | - - uses: azure/docker-login@v1 |
27 | | - with: |
28 | | - login-server: ${{ secrets.ACR_LOGIN_SERVER }} |
29 | | - username: ${{ secrets.ACR_USERNAME }} |
30 | | - password: ${{ secrets.ACR_PASSWORD }} |
| 26 | +# - uses: azure/docker-login@v1 |
| 27 | +# with: |
| 28 | +# login-server: ${{ secrets.ACR_LOGIN_SERVER }} |
| 29 | +# username: ${{ secrets.ACR_USERNAME }} |
| 30 | +# password: ${{ secrets.ACR_PASSWORD }} |
31 | 31 |
|
32 | | - - name: Build and Push Docker image |
33 | | - run: | |
34 | | - docker build -t ${{ secrets.ACR_USERNAME }}.azurecr.io/k8sdemo:$TAG . |
35 | | - docker push ${{ secrets.ACR_USERNAME }}.azurecr.io/k8sdemo:$TAG |
| 32 | +# - name: Build and Push Docker image |
| 33 | +# run: | |
| 34 | +# docker build -t ${{ secrets.ACR_USERNAME }}.azurecr.io/k8sdemo:$TAG . |
| 35 | +# docker push ${{ secrets.ACR_USERNAME }}.azurecr.io/k8sdemo:$TAG |
36 | 36 |
|
37 | | -# Deployment to Production |
38 | | - deploy-production: |
39 | | - runs-on: ubuntu-latest |
40 | | - needs: build |
41 | | - if: startsWith(github.ref, 'refs/tags/release') #Only runs for tags starting with 'release' |
| 37 | +# # Deployment to Production |
| 38 | +# deploy-production: |
| 39 | +# runs-on: ubuntu-latest |
| 40 | +# needs: build |
| 41 | +# if: startsWith(github.ref, 'refs/tags/release') #Only runs for tags starting with 'release' |
42 | 42 |
|
43 | | - steps: |
44 | | - - name: Checkout code |
45 | | - uses: actions/checkout@v2 |
| 43 | +# steps: |
| 44 | +# - name: Checkout code |
| 45 | +# uses: actions/checkout@v2 |
46 | 46 |
|
47 | | - - uses: Azure/aks-set-context@v1 |
48 | | - with: |
49 | | - creds: '${{ secrets.AZURE_CREDENTIALS }}' |
50 | | - cluster-name: '${{ secrets.CLUSTER_NAME_PROD }}' |
51 | | - resource-group: '${{ secrets.resource_group }}' |
| 47 | +# - uses: Azure/aks-set-context@v1 |
| 48 | +# with: |
| 49 | +# creds: '${{ secrets.AZURE_CREDENTIALS }}' |
| 50 | +# cluster-name: '${{ secrets.CLUSTER_NAME_PROD }}' |
| 51 | +# resource-group: '${{ secrets.resource_group }}' |
52 | 52 |
|
53 | | - - uses: Azure/k8s-create-secret@v1 |
54 | | - with: |
55 | | - container-registry-url: ${{ secrets.ACR_LOGIN_SERVER }} |
56 | | - container-registry-username: ${{ secrets.ACR_USERNAME }} |
57 | | - container-registry-password: ${{ secrets.ACR_PASSWORD }} |
58 | | - secret-name: k8s-secret |
| 53 | +# - uses: Azure/k8s-create-secret@v1 |
| 54 | +# with: |
| 55 | +# container-registry-url: ${{ secrets.ACR_LOGIN_SERVER }} |
| 56 | +# container-registry-username: ${{ secrets.ACR_USERNAME }} |
| 57 | +# container-registry-password: ${{ secrets.ACR_PASSWORD }} |
| 58 | +# secret-name: k8s-secret |
59 | 59 |
|
60 | | - - uses: Azure/k8s-deploy@v4 |
61 | | - with: |
62 | | - action: deploy |
63 | | - manifests: | |
64 | | - manifests/deployment.yaml |
65 | | - manifests/service.yaml |
66 | | - images: | |
67 | | - ${{ secrets.ACR_USERNAME }}.azurecr.io/k8sdemo:$TAG |
68 | | - imagepullsecrets: | |
69 | | - k8s-secret |
| 60 | +# - uses: Azure/k8s-deploy@v4 |
| 61 | +# with: |
| 62 | +# action: deploy |
| 63 | +# manifests: | |
| 64 | +# manifests/deployment.yaml |
| 65 | +# manifests/service.yaml |
| 66 | +# images: | |
| 67 | +# ${{ secrets.ACR_USERNAME }}.azurecr.io/k8sdemo:$TAG |
| 68 | +# imagepullsecrets: | |
| 69 | +# k8s-secret |
0 commit comments