Skip to content

Commit 2779e98

Browse files
committed
ci: removes dev from triggers
1 parent 3c5f8ab commit 2779e98

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

.azure-pipelines/ci-build.yml

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ trigger:
66
branches:
77
include:
88
- main
9-
- dev
109
- support/v1
1110
tags:
1211
include:
@@ -15,7 +14,6 @@ pr:
1514
branches:
1615
include:
1716
- main
18-
- dev
1917
- support/v1
2018
variables:
2119
buildPlatform: 'Any CPU'

.github/workflows/codeql-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CodeQL Analysis
22

33
on:
44
push:
5-
branches: [ main, dev ]
5+
branches: [ main, support/v1 ]
66
pull_request:
77
schedule:
88
- cron: '0 8 * * *'

.github/workflows/docker.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ name: Publish Docker image
22
on:
33
workflow_dispatch:
44
push:
5-
branches: [main, dev, support/v1]
5+
tags: ["v*"]
6+
branches: [main, support/v1]
67
paths: ['src/Microsoft.OpenApi.Hidi/**', '.github/workflows/**']
8+
pull_request:
79
env:
810
REGISTRY: msgraphprod.azurecr.io
911
IMAGE_NAME: public/openapi/hidi
12+
PREVIEW_BRANCH: "refs/heads/main"
1013
jobs:
1114
push_to_registry:
1215
environment:
@@ -28,14 +31,24 @@ jobs:
2831
echo "::set-output name=version::${version}"
2932
shell: pwsh
3033
id: getversion
34+
- name: Get truncated run number
35+
if: contains(github.ref, env.PREVIEW_BRANCH)
36+
id: runnumber
37+
run: echo "runnumber=$(echo ${{ github.run_number }} | awk '{ print substr($0, length($0)-3, length($0)) }')" >> $GITHUB_OUTPUT
38+
- name: Get current date
39+
if: contains(github.ref, env.PREVIEW_BRANCH)
40+
id: date
41+
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
3142
- name: Push to registry - Nightly
32-
if: ${{ github.ref == 'refs/heads/dev' }}
43+
if: contains(github.ref, env.PREVIEW_BRANCH)
3344
uses: docker/[email protected]
3445
with:
3546
push: true
36-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly
47+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.getversion.outputs.version }}-preview.${{ steps.date.outputs.date }}${{ steps.runnumber.outputs.runnumber }}
48+
build-args: |
49+
version_suffix=preview.${{ steps.date.outputs.date }}${{ steps.runnumber.outputs.runnumber }}
3750
- name: Push to registry - Release
38-
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/support/v1' }}
51+
if: contains(github.ref, 'refs/tags/v')
3952
uses: docker/[email protected]
4053
with:
4154
push: true

0 commit comments

Comments
 (0)