Skip to content

Commit

Permalink
add docker ci
Browse files Browse the repository at this point in the history
Co-authored-by: Morris Mukiri <morrismukiri@gmail.com>
  • Loading branch information
bennsimon and morrismukiri committed Apr 27, 2021
1 parent 51152b5 commit 2edc2fb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/docker-publish.yml
Expand Up @@ -6,6 +6,7 @@ on:
# See also https://github.com/crazy-max/ghaction-docker-meta#basic
branches:
- master
- add-docker-ci

# Publish `v1.2.3` tags as releases.
tags:
Expand Down Expand Up @@ -48,14 +49,23 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1


- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: opensrp/opensrp-server-web
images: opensrp/web
tag-custom: ${{ github.event.inputs.customTag }}

- name: Login to DockerHub
Expand All @@ -78,6 +88,16 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker_meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
3 changes: 2 additions & 1 deletion Dockerfile
Expand Up @@ -13,7 +13,8 @@ RUN chown -R node .
USER node

RUN cp /project/app/.env.sample /project/app/.env \
&& yarn
&& yarn --network-timeout 100000
# network timeout added to fix an issue with build on arm64 arch https://github.com/yarnpkg/yarn/issues/4890

USER root
RUN chown -R node .
Expand Down

0 comments on commit 2edc2fb

Please sign in to comment.