-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (42 loc) · 1.48 KB
/
github-actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: github-actions
on: [push]
env:
BUILD_IMAGE: bedasoftware/fhir-sdc
CACHE_IMAGE: bedasoftware/fhir-sdc:latest
TESTS_AIDBOX_LICENSE: ${{ secrets.TESTS_AIDBOX_LICENSE }}
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker pull ${{ env.CACHE_IMAGE }} || true
- run: >-
docker build --cache-from ${{ env.CACHE_IMAGE }}
--tag ${{ env.BUILD_IMAGE }} .
- name: Run tests
run: >-
mkdir ./tests_zen_project/zen-packages/ &&
ls -la ./test_zen_project &&
id &&
chmod -R 0666 ./tests_zen_project &&
./run_test.sh
- name: Show logs
if: ${{ failure() }}
run: docker-compose logs
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT
id: extract_branch
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- run: docker run --rm --privileged tonistiigi/binfmt --install all
- run: >-
docker buildx build --platform linux/arm64,linux/amd64
--cache-from ${{ env.CACHE_IMAGE }} --push
--tag ${{ env.BUILD_IMAGE }}:${{ steps.extract_branch.outputs.branch }} --tag ${{ env.CACHE_IMAGE }} .