-
Notifications
You must be signed in to change notification settings - Fork 12
42 lines (41 loc) · 1.64 KB
/
dristi-pdf.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Dristi-Pdf workflow
on:
push:
branches:
- main
- develop
paths:
- 'utilities/dristi-pdf/**'
pull_request:
branches:
- main
- develop
paths:
- 'utilities/dristi-pdf/**'
workflow_dispatch:
jobs:
docker_image-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup Docker
uses: docker/setup-buildx-action@v1
- name: Login to Azure Container Registry
if: (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
run: docker login -u pucardev -p ${{ secrets.ACR_PASSWORD }} pucardev.azurecr.io
- name: Build and Push Docker image for dristi-pdf
if: (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
run: |
docker build --build-arg WORK_DIR="utilities/dristi-pdf" -t pucardev.azurecr.io/dristi-pdf:v1.0.0-${{ github.sha }} -f utilities/dristi-pdf/Dockerfile .
docker push pucardev.azurecr.io/dristi-pdf:v1.0.0-${{ github.sha }}
- name: trigger deployment pipeline
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GHUB_TOKEN }}" \
https://api.github.com/repos/pucardotorg/pucar-Devops/actions/workflows/dev.yaml/dispatches \
-d '{"ref":"Dev-0"}'