Skip to content

Commit ca4128b

Browse files
authored
Merge pull request #2127 from microsoft/ci/remove-dev
ci: removes dev from triggers
2 parents f889937 + 503602e commit ca4128b

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
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-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ name: Publish Docker image
22
on:
33
workflow_dispatch:
44
push:
5-
branches: [main, dev, support/v1]
6-
paths: ['src/Microsoft.OpenApi.Hidi/**', '.github/workflows/**']
5+
tags: ["v*"]
6+
branches: [main]
7+
pull_request:
78
env:
89
REGISTRY: msgraphprod.azurecr.io
910
IMAGE_NAME: public/openapi/hidi
11+
PREVIEW_BRANCH: "refs/heads/main"
1012
jobs:
1113
push_to_registry:
1214
environment:
@@ -28,14 +30,24 @@ jobs:
2830
echo "::set-output name=version::${version}"
2931
shell: pwsh
3032
id: getversion
33+
- name: Get truncated run number
34+
if: contains(github.ref, env.PREVIEW_BRANCH)
35+
id: runnumber
36+
run: echo "runnumber=$(echo ${{ github.run_number }} | awk '{ print substr($0, length($0)-3, length($0)) }')" >> $GITHUB_OUTPUT
37+
- name: Get current date
38+
if: contains(github.ref, env.PREVIEW_BRANCH)
39+
id: date
40+
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
3141
- name: Push to registry - Nightly
32-
if: ${{ github.ref == 'refs/heads/dev' }}
42+
if: contains(github.ref, env.PREVIEW_BRANCH)
3343
uses: docker/[email protected]
3444
with:
3545
push: true
36-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly
46+
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 }}
47+
build-args: |
48+
version_suffix=preview.${{ steps.date.outputs.date }}${{ steps.runnumber.outputs.runnumber }}
3749
- name: Push to registry - Release
38-
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/support/v1' }}
50+
if: contains(github.ref, 'refs/tags/v')
3951
uses: docker/[email protected]
4052
with:
4153
push: true

0 commit comments

Comments
 (0)