mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: bun-dockerhub
|
|
on:
|
|
push:
|
|
paths:
|
|
- dockerhub/Dockerfile
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
paths:
|
|
- dockerhub/Dockerfile
|
|
branches:
|
|
- main
|
|
release:
|
|
types:
|
|
- published
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
if: github.repository_owner == 'oven-sh'
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v3
|
|
- name: Collect metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: |
|
|
${{ secrets.DOCKERHUB_USERNAME }}/bun
|
|
tags: |
|
|
type=match,pattern=bun-v(\d.\d.\d),group=1
|
|
type=match,pattern=bun-v(\d.\d),group=1
|
|
type=match,pattern=bun-v(\d),group=1
|
|
type=ref,event=branch
|
|
type=ref,event=pr
|
|
- name: Login to DockerHub
|
|
if: github.event_name == 'release'
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Build image
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: ./dockerhub
|
|
push: ${{ github.event_name == 'release' }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|