66 lines
1.9 KiB
YAML
66 lines
1.9 KiB
YAML
name: Publish Docker images
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['v*']
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
push_images_to_docker_hub:
|
|
name: Push images to Docker Hub
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out the repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Extract Builder meta
|
|
id: builder-meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: baptistearno/typebot-builder
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
|
|
- name: Extract Viewer meta
|
|
id: viewer-meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: baptistearno/typebot-viewer
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
|
|
- name: Log in to Docker Hub
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and push builder image
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.builder-meta.outputs.tags }}
|
|
labels: ${{ steps.builder-meta.outputs.labels }}
|
|
build-args: |
|
|
SCOPE=builder
|
|
|
|
- name: Build and push viewer image
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.viewer-meta.outputs.tags }}
|
|
labels: ${{ steps.viewer-meta.outputs.labels }}
|
|
build-args: |
|
|
SCOPE=viewer
|