-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from Roopan-Microsoft/PSL-US-8941
feat: Updated git workflow and bicep for multi pipeline based on branch
- Loading branch information
Showing
5 changed files
with
198 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ on: | |
push: | ||
branches: | ||
- main | ||
- dev | ||
- demo | ||
schedule: | ||
- cron: '0 6,18 * * *' # Runs at 6:00 AM and 6:00 PM GMT | ||
|
||
|
@@ -34,6 +36,17 @@ jobs: | |
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set imageTag | ||
id: set-image-tag | ||
run: | | ||
if [[ "${{ github.event_name }}" == "schedule" ]]; then | ||
echo "imageTag=latest" >> $GITHUB_ENV | ||
elif [[ "${{ github.ref_name }}" == "main" ]]; then | ||
echo "imageTag=latest" >> $GITHUB_ENV | ||
else | ||
echo "imageTag=${{ github.ref_name }}" >> $GITHUB_ENV | ||
fi | ||
- name: Pre-build image and run make in dev container | ||
uses: devcontainers/[email protected] | ||
env: | ||
|
@@ -42,8 +55,9 @@ jobs: | |
with: | ||
imageName: ghcr.io/roopan-microsoft/psl-cwyd-main | ||
cacheFrom: ghcr.io/roopan-microsoft/psl-cwyd-main | ||
imageTag: ${{ env.imageTag }} | ||
runCmd: make ci && make deploy | ||
refFilterForPush: refs/heads/main | ||
refFilterForPush: refs/heads/${{ github.event_name == 'schedule' && 'main' || github.ref_name }} | ||
env: | | ||
AZURE_CLIENT_ID | ||
AZURE_CLIENT_SECRET | ||
|
@@ -61,6 +75,7 @@ jobs: | |
with: | ||
push: never | ||
imageName: ghcr.io/roopan-microsoft/psl-cwyd-main | ||
imageTag: ${{ env.imageTag }} | ||
runCmd: make destroy | ||
env: | | ||
AZURE_CLIENT_ID | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.