Some checks failed
publish-images / docker-build-and-push (push) Failing after 23s
65 lines
1.8 KiB
YAML
65 lines
1.8 KiB
YAML
name: publish-images
|
|
|
|
on:
|
|
push:
|
|
branches: [ dev, main ]
|
|
tags: [ 'v*' ]
|
|
|
|
env:
|
|
REGISTRY: git.4nkweb.com
|
|
IMAGE_OWNER: 4nk
|
|
IMAGE_REPO: 4NK_IA_back
|
|
|
|
jobs:
|
|
docker-build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ secrets.USER }}
|
|
password: ${{ secrets.TOKEN }}
|
|
|
|
- name: Compute tags
|
|
id: meta
|
|
run: |
|
|
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
|
|
VERSION_TAG="${GITHUB_REF_NAME}"
|
|
else
|
|
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-8)
|
|
VERSION_TAG="sha-${SHORT_SHA}"
|
|
fi
|
|
echo "version=${VERSION_TAG}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build & Push host-api
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./docker/host-api
|
|
file: ./docker/host-api/Dockerfile
|
|
push: true
|
|
platforms: linux/amd64
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_REPO }}/host-api:${{ steps.meta.outputs.version }}
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_REPO }}/host-api:latest
|
|
|
|
- name: Build & Push worker
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./docker/worker/Dockerfile
|
|
push: true
|
|
platforms: linux/amd64
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_REPO }}/worker:${{ steps.meta.outputs.version }}
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_REPO }}/worker:latest
|