Skip to content

Update publish_foss_docker.yml #21

Update publish_foss_docker.yml

Update publish_foss_docker.yml #21

# #
# # This action will publish Chatwoot CE docker image.
# # This is set to run against merges to develop, master
# # and when tags are created.
# #
name: Publish Chatwoot CE docker images for AMD64
on:
push:
branches:
- develop
- master
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
env:
IMAGE_NAME: wkarts/chatwoot
GIT_REF: ${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set up Docker tag
id: docker_tag
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
elif [[ "${GITHUB_REF}" == refs/heads/develop ]]; then
echo "TAG=develop" >> $GITHUB_ENV
elif [[ "${GITHUB_REF}" == refs/heads/master ]]; then
echo "TAG=latest" >> $GITHUB_ENV
- name: Build and push amd64 image
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ env.IMAGE_NAME }}:${{ env.TAG }}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}