forked from ornladios/ADIOS2
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.35 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
name: Docker
on:
push:
branches:
- master
- release*
pull_request:
branches:
- master
- release*
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
baseos: [
ubuntu18.04,
ubuntu20.04 ]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Build image
run: |
if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]
then
adios_ver="pr$(expr "${GITHUB_REF}" : 'refs/pull/\([^/]*\)')"
else
adios_ver="${GITHUB_REF##refs/heads/}"
fi
echo "adios_ver=${adios_ver}"
docker build \
-t ornladios/adios2:${adios_ver}-${{ matrix.baseos }} \
--build-arg adios_ver=${adios_ver} \
--build-arg base=${{ matrix.baseos }} \
scripts/docker/complete
- name: Push image to Docker Hub
if: github.event_name == 'push'
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
run: |
docker login \
--username="${DOCKERHUB_USERNAME}" \
--password="${DOCKERHUB_PASSWORD}" && \
docker push \
ornladios/adios2:${GITHUB_REF##refs/heads/}-${{ matrix.baseos }}