image-service-erlang/.github/workflows/pr-ci-check.yaml
Andrey Fadeev b634290415
Add GitHub Actions (#25)
* Use http protocol for build_utils submodule

* Update to rbkmoney/build_utils@29cb2775

* Switch to utils' targets usage for image building

* Add github actions

* Fix submodule target

* Remove double SERVICE_IMAGE_TAG definig

* Fix build-utils
2021-03-04 20:19:20 +03:00

44 lines
1.2 KiB
YAML

name: Pull Request Check
on:
pull_request:
branches:
- master
jobs:
test-build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile.sh', 'Makefile') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Initialize build-utils
run: make submodules
- name: Build image
run: make build_image
env:
ORG_NAME: ${{ github.repository_owner }}
REGISTRY: ghcr.io
DOCKER: docker buildx
DOCKER_BUILD_OPTIONS: >-
--cache-to type=local,dest=/tmp/.buildx-cache-new
--cache-from type=local,src=/tmp/.buildx-cache
--platform linux/amd64
- name: Move cache
# Work-around to remove old layers
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache