mirror of
https://gitlab.com/Anson-Projects/projects.git
synced 2025-09-14 09:35:04 +00:00
Add branch preview deployment and local testing
- Add preview environment for feature branch testing - Create local deployment test script - Enable testing without requiring main branch - Preview URL: project-branch.gitlab.io
This commit is contained in:
@@ -32,6 +32,23 @@ deploy:
|
||||
paths:
|
||||
- public
|
||||
|
||||
# Branch preview deployment (for testing)
|
||||
preview:
|
||||
stage: deploy
|
||||
script:
|
||||
- echo "Deploying branch preview..."
|
||||
- echo "Preview available at: ${CI_ENVIRONMENT_URL}"
|
||||
needs:
|
||||
- deploy
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
environment:
|
||||
name: preview/$CI_COMMIT_REF_SLUG
|
||||
url: https://${CI_PROJECT_PATH_SLUG}-${CI_COMMIT_REF_SLUG}.gitlab.io
|
||||
rules:
|
||||
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
|
||||
|
||||
# GitLab Pages deployment (only on main branch)
|
||||
pages:
|
||||
stage: deploy
|
||||
|
Reference in New Issue
Block a user