See below for my YAML code that I have in Azure pipeline, it is based off of a pipeline I created that works great for building and deploying.
I'm hoping to create a new pipeline that triggers when there is a PR to the "main" branch, and it builds the branch in the PR to see if there are any build issues before we merge it with the "main" branch. I believe the name for this is Build Validation, but I'm stuck with creating the pipeline. Or is this right and I need to handle this with settings in the build validation setup?
I tried to update the YAML so it only runs when a PR is created, I think that part is okay. But I can't seem to figure out how to cancel the deployment part. The changes I make keep breaking in the build process of my existing normal pipeline.
name: Azure Static Web Apps CI/CD
pr:
branches:
include:
- main
trigger: none
jobs:
- job: build_and_deploy_job
displayName: Build and Deploy Job
condition: or(eq(variables['Build.Reason'], 'Manual'),or(eq(variables['Build.Reason'], 'PullRequest'),eq(variables['Build.Reason'], 'IndividualCI')))
pool:
vmImage: ubuntu-latest
variables:
- group: Azure-Static-Web-Apps
steps:
- checkout: self
submodules: true
- task: AzureStaticWebApp@0
inputs:
azure_static_web_apps_api_token: $(AZURE_STATIC_WEB_APPS)
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit:
https://aka.ms/swaworkflowconfig
/>
app_location: "/" # App source code path
api_location: "" # Api source code path - optional
output_location: "" # Built app content directory - optional
env:
NEXT_PUBLIC_OPENAI_KEY: $(NEXT_PUBLIC_OPENAI_KEY)
###### End of Repository/Build Configurations ######
How do i tweak my YAML file so that it builds but does not deploy? I want to set up a PR Build pipeline to test build each PR
Programing Coderfunda
February 05, 2024
No comments
Related Posts:
Multi-purpose Value Objects for Laravel Laravel Value Objects is a collection of general-purpose value objects you can use in your Laravel application. Value objects help rep… Read More
Laravel Blade Country and Language Icons Laravel Blade Flags is a package to easily display countries & languages flags in your Laravel Blade views. When you have a projec… Read More
Assert DOM Elements in Laravel Tests The Laravel DOM Assertions package by René Sinnbeck adds document object model (DOM) assertion helpers to Laravel's Tes… Read More
Laravel Model Flags Package Laravel Model Flags is a package by Spatie to allow you to add flags to an Eloquent model:This package adds a HasFlags trait… Read More
Attach Time-sliced Metadata to Eloquent Models Laravel Multiplex is a Laravel package to attach time-sliced metadata to Eloquent models. With the v1.0 release near, here are the mai… Read More
0 comments:
Post a Comment
Thanks