forked from geodynamics/aspect
-
Notifications
You must be signed in to change notification settings - Fork 3
125 lines (108 loc) · 3.74 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: github-docker
on:
push:
branches:
- 'main'
release:
types: [published]
# If a merged PR triggers a rebuild of this docker image, and another
# PR is merged during the build, cancel the first of these since (i) this
# is a waste of time, and (ii) it creates a race condition with the
# upload.
concurrency:
group: docker-build
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
build-docker:
runs-on: ubuntu-latest
if: github.repository == 'geodynamics/aspect'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_LOGIN }}
- name: Build and push Docker image for main
if: contains(github.event_name, 'push')
uses: docker/build-push-action@v6
with:
context: ./contrib/docker/docker/
cache-from: type=registry,ref=ubuntu:22.04
cache-to: type=inline
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
${{ github.repository }}:latest
- name: Build and push Docker image for release
if: contains(github.event_name, 'release')
uses: docker/build-push-action@v6
with:
context: ./contrib/docker/docker/
cache-from: type=registry,ref=ubuntu:22.04
cache-to: type=inline
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:${{github.ref_name}}
${{ github.repository }}:${{github.ref_name}}
build-docker-tacc:
runs-on: ubuntu-latest
if: github.repository == 'geodynamics/aspect'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_LOGIN }}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image for main
if: contains(github.event_name, 'push')
uses: docker/build-push-action@v6
with:
context: ./contrib/docker/docker_tacc/
cache-from: type=registry,ref=ubuntu:22.04
cache-to: type=inline
platforms: linux/amd64
push: true
tags: |
ghcr.io/${{ github.repository }}:latest-tacc
${{ github.repository }}:latest-tacc
- name: Build and push Docker image for release
if: contains(github.event_name, 'release')
uses: docker/build-push-action@v6
with:
context: ./contrib/docker/docker_tacc/
cache-from: type=registry,ref=ubuntu:22.04
cache-to: type=inline
platforms: linux/amd64
push: true
tags: |
ghcr.io/${{ github.repository }}:${{github.ref_name}}-tacc
${{ github.repository }}:${{github.ref_name}}-tacc