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:
VBA download file from website - popup windowI am trying to automate a file downloading from a website. When I do the download manually, all I have to do is to click on the "save" icon (floppy di… Read More
How would you structure a system with multiple bussiness "regions"?For example, an e-commerce site, where there are a "region" for the sellers, with feature align to managing products or selling analytic. And a front-… Read More
Small but powerful CLI apps with Minicli Minicli is a lightweight PHP structure for building order line applications. While it gives a moderate methodology, you can in any case make str… Read More
Laravel Octane Adds Support for Roadrunner v3The Laravel team release Octane v2 with support for Roadrunner v3! The post Laravel Octane Adds Support for Roadrunner v3 appeared first on Laravel… Read More
Laravel Security Middleware Laravel provides a set of middleware that you can use to enhance the security of your web application. These middleware can help protect against… Read More
0 comments:
Post a Comment
Thanks