ci: trigger stage build on PRs (deploy only on merge)
This commit is contained in:
@@ -14,6 +14,16 @@ on:
|
||||
- 'build-stage.sh'
|
||||
- '.gitea/workflows/stage.yaml'
|
||||
|
||||
pull_request:
|
||||
branches: [stage]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'dist/**'
|
||||
- 'runtime/**'
|
||||
- 'Dockerfile.stage'
|
||||
- 'build-stage.sh'
|
||||
- '.gitea/workflows/stage.yaml'
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
@@ -134,13 +144,13 @@ jobs:
|
||||
docker tag "marketing:${{ steps.tag.outputs.tag }}" "us-central1-docker.pkg.dev/neuron-785695/neuron-marketing/marketing:stage-latest"
|
||||
|
||||
- name: Push image
|
||||
if: steps.changetype.outputs.asset_only != 'true'
|
||||
if: steps.changetype.outputs.asset_only != 'true' && github.event_name != 'pull_request'
|
||||
run: |
|
||||
docker push "${{ steps.tag.outputs.image }}"
|
||||
docker push "us-central1-docker.pkg.dev/neuron-785695/neuron-marketing/marketing:stage-latest"
|
||||
|
||||
- name: Asset-only fast build
|
||||
if: steps.changetype.outputs.asset_only == 'true'
|
||||
if: steps.changetype.outputs.asset_only == 'true' && github.event_name != 'pull_request'
|
||||
env:
|
||||
IMAGE: ${{ steps.tag.outputs.image }}
|
||||
run: |
|
||||
@@ -165,6 +175,7 @@ jobs:
|
||||
echo "Fast asset build complete"
|
||||
|
||||
- name: Deploy to marketing-stage
|
||||
if: github.event_name != 'pull_request'
|
||||
id: deploy-stage
|
||||
env:
|
||||
IMAGE: ${{ steps.tag.outputs.image }}
|
||||
@@ -193,6 +204,7 @@ jobs:
|
||||
--quiet
|
||||
|
||||
- name: Smoke test stage
|
||||
if: github.event_name != 'pull_request'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
STAGE_URL="${{ steps.deploy-stage.outputs.stage_url }}"
|
||||
|
||||
Reference in New Issue
Block a user