-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (45 loc) · 1.81 KB
/
dev_workflow.yaml
File metadata and controls
46 lines (45 loc) · 1.81 KB
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
43
44
45
46
on:
pull_request:
branches: [dev]
types:
- closed
workflow_dispatch:
jobs:
Build:
environment: Development
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v2
- uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_DOMAIN }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Publish image to Azure Registry
run: |
docker build -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.ref_name == 'main' && 'prod' || github.ref_name }}${{ github.ref_name != 'main' && '-latest' || 'latest' }} .
docker push ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }} --all-tags
Deploy:
needs: Build
environment:
name: Development
runs-on: ubuntu-latest
steps:
- name: Login to Azure
uses: azure/login@v2.0.0
with:
creds: ${{secrets.TDEI_CORE_AZURE_CREDS}}
- name: Deploy to Dev
uses: azure/webapps-deploy@v2
with:
app-name: ${{ secrets.AZURE_WEBAPP_NAME }}
images: ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Test
run: |
curl -X POST https://api.github.com/repos/TaskarCenterAtUW/TDEI-management-api-client/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.ACTIONS_KEY }} \
--data '{"event_type": "auto_generate_api_client"}'
- uses: actions/checkout@v3