Skip to content

[DOP-11711] Run tests in github actions #2

[DOP-11711] Run tests in github actions

[DOP-11711] Run tests in github actions #2

Workflow file for this run

name: Docker image
on:
push:
branches:
- develop
pull_request:
branches-ignore:
- master
workflow_dispatch:
jobs:
release:
name: Build & push image to Dockerhub
runs-on: ubuntu-latest
if: github.repository == 'MobileTeleSystems/syncmaster' # prevent running on forks
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout code
uses: actions/checkout@v4
- name: Set tag
id: set_tag
run: |
if [[ "${{ github.ref_type }}" == "branch" && "${{ github.ref_name }}" == "develop" ]]; then
echo "TAG=mtsrus/syncmaster-backend:develop" >> $GITHUB_ENV
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
echo "TAG=mtsrus/syncmaster-backend:latest,mtsrus/syncmaster-backend:${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Build Backend image
uses: docker/build-push-action@v5
with:
tags: test
context: .
file: docker/backend.dockerfile
pull: true
push: true
cache-to: type=gha,mode=max
cache-from: type=gha
platforms: |
linux/amd64
linux/arm64/v8
provenance: mode=max