2022-04-06 15:44:04 +00:00
|
|
|
# #
|
|
|
|
# # This action will publish Chatwoot CE docker image.
|
|
|
|
# # This is set to run against merges to develop, master
|
2022-04-14 11:45:57 +00:00
|
|
|
# # and when tags are created.
|
2022-04-06 15:44:04 +00:00
|
|
|
# #
|
|
|
|
|
|
|
|
name: Publish Chatwoot CE docker images
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
|
|
|
- master
|
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
GIT_REF: ${{ github.head_ref || github.ref_name }} # ref_name to get tags/branches
|
|
|
|
steps:
|
2022-04-14 11:45:57 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
2022-04-06 15:44:04 +00:00
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
|
|
- name: Strip enterprise code
|
|
|
|
run: |
|
|
|
|
rm -rf enterprise
|
|
|
|
rm -rf spec/enterprise
|
|
|
|
|
2022-04-14 11:45:57 +00:00
|
|
|
- name: Set Chatwoot edition
|
|
|
|
run: |
|
|
|
|
echo -en '\nENV CW_EDITION="ce"' >> docker/Dockerfile
|
|
|
|
|
2022-04-06 15:44:04 +00:00
|
|
|
- name: set docker tag
|
|
|
|
run: |
|
|
|
|
echo "DOCKER_TAG=chatwoot/chatwoot:$GIT_REF-ce" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: replace docker tag if master
|
|
|
|
if: github.ref_name == 'master'
|
|
|
|
run: |
|
|
|
|
echo "DOCKER_TAG=chatwoot/chatwoot:latest-ce" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
2022-04-14 11:45:57 +00:00
|
|
|
context: .
|
2022-04-06 15:44:04 +00:00
|
|
|
file: docker/Dockerfile
|
2022-10-05 11:37:49 +00:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-04-06 15:44:04 +00:00
|
|
|
push: true
|
|
|
|
tags: ${{ env.DOCKER_TAG }}
|