build(docker): 👷 Build images on push
This commit is contained in:
52
.github/workflows/publish_docker_images.yml
vendored
52
.github/workflows/publish_docker_images.yml
vendored
@@ -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
|
name: Publish Docker images
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches: [main]
|
||||||
- 'v*.*.*'
|
tags: ['v*']
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
push_images_to_docker_hub:
|
push_images_to_docker_hub:
|
||||||
@@ -17,11 +14,32 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Check out the repo
|
- name: Check out the repo
|
||||||
uses: actions/checkout@v3
|
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
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
@@ -30,10 +48,9 @@ jobs:
|
|||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: |
|
tags: ${{ steps.builder-meta.outputs.tags }}
|
||||||
baptistearno/typebot-builder:latest
|
labels: ${{ steps.builder-meta.outputs.labels }}
|
||||||
baptistearno/typebot-builder:${{ env.RELEASE_VERSION }}
|
|
||||||
build-args: |
|
build-args: |
|
||||||
SCOPE=builder
|
SCOPE=builder
|
||||||
|
|
||||||
@@ -41,9 +58,8 @@ jobs:
|
|||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: |
|
tags: ${{ steps.viewer-meta.outputs.tags }}
|
||||||
baptistearno/typebot-viewer:latest
|
labels: ${{ steps.viewer-meta.outputs.labels }}
|
||||||
baptistearno/typebot-viewer:${{ env.RELEASE_VERSION }}
|
|
||||||
build-args: |
|
build-args: |
|
||||||
SCOPE=viewer
|
SCOPE=viewer
|
||||||
|
|||||||
Reference in New Issue
Block a user