How we deploy every pull request to a seperate domain.

Here is your deployed pull request (source: https://unsplash.com/photos/3syTDiVAc7w)

But why?

  1. We checkout the branch on our local development machines
  2. We build the project
  3. We test the build for errors
  4. Finally we review the code itself

What do you need?

Let’s set it up!

Tokens

GitHub token scopes

CI Server

The Script

#!/bin/bash# deploy to surge.sh
npx surge --project ${BUILD_DIR} --domain ${TRAVIS_PULL_REQUEST}.${SURGE_SUBDOMAIN}.surge.sh
# comment url to pull request
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST -d "{\"body\": \"❤️ I have deployed this pull-request for you: \nhttp://${TRAVIS_PULL_REQUEST}.${SURGE_SUBDOMAIN}.surge.sh\"}" "https://api.github.com/repos/${TRAVIS_REPO_SLUG}/issues/${TRAVIS_PULL_REQUEST}/comments"
travis ci environment variables

--

--

--

https://adrianjost.dev

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Tezos Rust node: How to call the Tezos protocol from Rust

Misconceptions About No-Code

misconceptions no code

How to upgrade OCP4 in the restricted network ?

Spring Boot Application with Apache Cassandra running on separate containers — in 10 steps.

Add logging to your Dropwizard application using Sematext

Choosing a Cloud Service Provider — Are There Any Alternatives to Amazon Web Services

What are microservices?

loc and iloc function in python

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adrian Jost

Adrian Jost

https://adrianjost.dev

More from Medium

How I fixed disconnects of Xbox 360 Controller on Windows

Valgrind in macOS with Docker

Result of the above command

Version Control using Git and Github (Part 1)

Storage Possibilities

Young man peering into an open gift box