DEV Community

Cover image for Using Github Actions with Bun
Jonas Scholz
Jonas Scholz Subscriber

Posted on

12 2 2 2 3

Using Github Actions with Bun

Still using Bun after last week's hype? Great! Let's learn together how you can use Github Actions and Bun πŸš€πŸž

Setup

I am assuming that you already have a GitHub repository with a working bun project. If not, you can find everything in this public GitHub Repository

Create a file in .github/workflows/test.yaml and copy-paste the following yaml. You will probably only need to change the last line!

name: Test Bun # Name it however you want

on:
  push:
    branches:
      - main # Execute on every push
  workflow_dispatch: # Execute on manual trigger

jobs:
  build-and-start:
    runs-on: ubuntu-latest # Linux base image
    steps:
      - uses: actions/checkout@v3 # Checkout repo
      - uses: oven-sh/setup-bun@v1 # Setup bun
        with:
            bun-version: latest # You can also use a specific version
      - run: bun install # Only needed if you have any dependencies
      - run: bun ./print.ts # Change to your entrypoint!
Enter fullscreen mode Exit fullscreen mode

You can now see your Action runs here:

GitHub Actions

Conclusion

I'd love to know if you are already using Bun for a project! How has the journey been so far? And how are you going to use Github Actions for it? 😊

πŸ‘‹ While you are here

Reinvent your career. Join DEV.

It takes one minute and is worth it for your career.

Get started

Top comments (2)

Collapse
 
hasanelsherbiny profile image
Hasan Elsherbiny β€’

πŸ‘πŸ‘

Collapse
 
code42cate profile image
Jonas Scholz β€’

Glad that you enjoyed it:)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❀️