-
Notifications
You must be signed in to change notification settings - Fork 552
50 lines (46 loc) · 1.39 KB
/
branchtest.yml
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
47
48
49
50
name: Deploy and Test Branch
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
branches: [develop]
jobs:
skip-check:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.skip.outputs.skip }}
steps:
- id: skip
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'always'
getbranch:
runs-on: ubuntu-latest
needs: skip-check
if: ${{ needs.skip-check.outputs.skip != 'true' }}
outputs:
netclientbranch: ${{ steps.getbranch.outputs.netclientbranch }}
steps:
- name: checkout
uses: actions/checkout@v3
with:
repository: gravitl/netclient
ref: develop
- name: check if branch exists
id: getbranch
run: |
if git show-ref ${{ github.head_ref}}; then
echo branch exists
echo "netclientbranch=${{ github.head_ref }}" >> $GITHUB_OUTPUT
else
echo branch does not exist
echo "netclientbranch=develop" >> $GITHUB_OUTPUT
fi
branchtest:
uses: gravitl/devops/.github/workflows/testdeploybranch.yml@master
needs: [getbranch, skip-check]
with:
netclientbranch: ${{ needs.getbranch.outputs.netclientbranch }}
netmakerbranch: ${{ github.head_ref }}
tag: ${{ github.run_id }}-${{ github.run_attempt }}
secrets: inherit