Code Monkey home page Code Monkey logo

gitpod-hosted-runner's Introduction

Debugging GitHub Actions using Gitpod

Testing out the GitHub Actions is a tough task, especially when you are dealing with Self-Hosted Runners for your enterprises. With this repository, you can set up and use a self-hosted runner within Gitpod's Cloud Development Environment (CDE).

Setup

Step 1: Generate a GitHub Personal Access Token

To use a self-hosted runner, you need to generate a personal access token (PAT) in GitHub. The token must have repo scope if you're going to use the runner with a private repository, or public_repo scope if you're going to use it with a public repository. You can use a PAT to configure each self-hosted runner or you can use the same PAT for each self-hosted runner that you create.

Step 2: Configure the GitHub Personal Access Token

Set the GitHub Personal Access Token as RUNNER_TOKEN in Gitpod Environment Variables with scope to your repository {REPO_OWNER_NAME}/{REPO_NAME} for that certain repository (Recommended) OR */* for all Repositories you will open in Gitpod Workspace.

Env Variables

Step 3: Start the Gitpod Workspace

It would open a fresh, ephemeral CDE with GitHub CLI Installed & ready-to-use.

Open in Gitpod

Usage

Step 1: Create a Self-Hosted Runner

You can easily create a self-hosted runner using the GitHub CLI. For example, the following command creates a self-hosted runner in the current repository. You can pass any preferred name for your runner.

source create-runner.sh siddhant-demo-runner-01

Step 2: Use & Run GitHub Action Workflow Self-Hosted Runner

Once the self-hosted runner is set up and running, you can utilize it in your GitHub Actions workflows.

  • Open your GitHub repository.

  • Navigate to the Actions tab.

  • Create or modify a workflow file (e.g., .github/workflows/demo.yml). Specify the runner label in your workflow file to target the self-hosted runner. For example:

    jobs:
    build:
      runs-on: self-hosted
  • Commit and push your workflow file to trigger the workflow using the self-hosted runner.

    Actions Workflow Output


Here, Machine name will be your Gitpod Workspace URL.

🗒️ Note

♻️ Reuse in Existing Gitpod Workspace

If you've got an existing Gitpod workspace that you want to turn into a runner:

  • Set the GitHub PAT Token above as Gitpod environment variables.
  • Run create-runner.sh in the terminal with above instructions.

gitpod-hosted-runner's People

Contributors

imgbot[bot] avatar siddhant-k-code avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.