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? 😊

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (2)

Collapse
 
hasanelsherbiny profile image
Hasan Elsherbiny β€’

πŸ‘πŸ‘

Collapse
 
code42cate profile image
Jonas Scholz β€’

Glad that you enjoyed it:)

Cloudinary image

Video API: manage, encode, and optimize for any device, channel or network condition. Deliver branded video experiences in minutes and get deep engagement insights.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay