Skip to content

Instantly share code, notes, and snippets.

@yousuf-hossain-shanto
Last active April 6, 2022 05:36
Show Gist options
  • Select an option

  • Save yousuf-hossain-shanto/c5630f9cfd1378c78408946e63c12283 to your computer and use it in GitHub Desktop.

Select an option

Save yousuf-hossain-shanto/c5630f9cfd1378c78408946e63c12283 to your computer and use it in GitHub Desktop.
Gitlab CI for Laravel Vapor
deploy:
stage: deploy
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_BRANCH == "develop"'
when: always
image: bitnami/laravel
variables:
VAPOR_API_TOKEN: $VAPOR_API_TOKEN
script:
- composer install --no-interaction --prefer-dist --optimize-autoloader
- composer global require laravel/vapor-cli
- VAPOR_API_TOKEN=$VAPOR_API_TOKEN ./vendor/bin/vapor deploy staging --commit="${CI_COMMIT_ID}" --message="${CI_MESSAGE}"
@yousuf-hossain-shanto
Copy link
Author

yousuf-hossain-shanto commented Apr 6, 2022

Working on merge and push branch. Fixed duplicate job issue on merge request

  1. Change develop to branch you want to deploy from
  2. Change staging to your Laravel Vapor deploy type
  3. Set a CI/CD variable "VAPOR_API_TOKEN" into your repository Check Here

One more thing, don't forget to hit on star 😌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment