Skip to content

Commit

Permalink
build(docker): 👷 Build images on push
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed May 31, 2022
1 parent ff5c368 commit 5e19f79
Showing 1 changed file with 34 additions and 18 deletions.
52 changes: 34 additions & 18 deletions .github/workflows/publish_docker_images.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Publish Docker images

on:
push:
tags:
- 'v*.*.*'
branches: [main]
tags: ['v*']
pull_request:
branches: [main]

jobs:
push_images_to_docker_hub:
Expand All @@ -17,11 +14,32 @@ jobs:
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- 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
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand All @@ -30,20 +48,18 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: |
baptistearno/typebot-builder:latest
baptistearno/typebot-builder:${{ env.RELEASE_VERSION }}
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: true
tags: |
baptistearno/typebot-viewer:latest
baptistearno/typebot-viewer:${{ env.RELEASE_VERSION }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.viewer-meta.outputs.tags }}
labels: ${{ steps.viewer-meta.outputs.labels }}
build-args: |
SCOPE=viewer

4 comments on commit 5e19f79

@vercel
Copy link

@vercel vercel bot commented on 5e19f79 May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5e19f79 May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5e19f79 May 31, 2022

@vercel
Copy link

@vercel vercel bot commented on 5e19f79 May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

app.typebot.io
builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app

Please sign in to comment.