-
Notifications
You must be signed in to change notification settings - Fork 50
79 lines (74 loc) · 2.27 KB
/
docker.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Docker
on:
push:
branches:
- master
tags:
- v[0-9]*
pull_request:
branches:
- master
schedule:
- cron: '0 8 * * FRI'
concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout kokkos
uses: actions/[email protected]
with:
repository: kokkos/kokkos
ref: master
path: kokkos
- name: Checkout arborx
uses: actions/[email protected]
with:
repository: arborx/ArborX
ref: master
path: arborx
- name: Checkout heffte
# actions/checkout doesn't work for external repos yet
run: |
git clone --depth 1 --branch v2.3.0 https://bitbucket.org/icl/heffte.git heffte
- name: Checkout hypre
uses: actions/[email protected]
with:
repository: hypre-space/hypre
ref: v2.22.1
path: hypre
- name: Checkout Cabana
uses: actions/[email protected]
with:
path: cabana
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare
id: prep
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION=pr-${{ github.event.number }}
fi
if [[ $VERSION = master ]]; then
VERSION=latest
fi
echo VERSION=${VERSION}
echo ::set-output name=version::${VERSION}
- name: Build and Push Docker Image
id: docker_build
uses: docker/build-push-action@v2
with:
context: ${{github.workspace}}
file: cabana/.github/workflows/Dockerfile
push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
tags: ghcr.io/ecp-copa/cabana:${{ steps.prep.outputs.version }}