-
Notifications
You must be signed in to change notification settings - Fork 16
36 lines (28 loc) · 940 Bytes
/
docker-image.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
name: Generate build env image
on:
push:
branches: ["develop", "task/github-actions"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: llnl/spheral
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build env image
run: docker build --target spheral-build-env-local --tag spheral-build-env .
- name: build spheral image
run: docker build --target spheral --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest --network none .
- name: push docker image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest