preloader

Announcing Our New GitHub Actions Integration

Check out Shipyard’s new GitHub Action and read about how to integrate it into your CI/CD workflow

/images/blog/cover-images/GitHub-Action.png
Shipyard's GitHub Action

by Akshay Kalia on May 18, 2022

We are excited to make it easier than ever to use Shipyard inside GitHub Actions, bringing the ability to connect ephemeral environments to your CI/CD workflows. Using our new GitHub Action, you can run CI jobs (integration/e2e tests) off Shipyard ephemeral environments which are automatically deployed on every pull request.

How it works

Previously if you wanted to use GitHub Actions with Shipyard, you’d have to connect directly to Shipyard via our API using your own bespoke script.

The Shipyard GitHub Action connects to Shipyard, requests the URL for an environment specified by hash, and gives you the bypass token you need to circumvent the SSO OAuth provided by Shipyard. Of course the Action also lets you know when the environment is fully built and ready to be used by your CI test runner.

Once you have the appropriate bypass token and environment URL this can be passed to other actions in your workflows. Now you can run your full test suite on every pull request! This is the same functionality accessible through our CircleCI orb and is commonly used for our customers who perform end-to-end testing with tools like Cypress, Playwright, or Selenium.

Getting started

Shipyard’s GitHub Action can be implemented and used in two simple steps.

1) Add the Shipyard Action to your workflow

- name: Fetch Shipyard Tokens
  uses: shipyard/github-action/fetch-shipyard-env@1.0.0
  env:
    SHIPYARD_API_TOKEN: ${{ secrets.SHIPYARD_API_TOKEN }}

2) Pass Shipyard’s output to another job, in this example we are running our e2e tests using Cypress.io

- name: Run the e2e tests against the ephemeral environment
  run: npm run test
  shell: bash
  env:
    CYPRESS_BASH_URL: $SHIPYARD_ENVIRONMENT_URL
    CYPRESS_BYPASS_TOKEN: $SHIPYARD_BYPASS_TOKEN

Read more about the configurations and outputs here.

New to using Actions workflows?

GitHub has a catalog of workflows that are recommended based on the code in your repository. You can learn more about GitHub Actions workflows in our documentation. For any questions or suggestions, join the discussion here.

Share:
comments powered by Disqus

Sign up for our Newsletter