-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (35 loc) · 1.21 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
name: Check and build Dockerfile
on:
push:
branches: [ master ]
pull_request:
concurrency:
group: ${{
( github.ref == 'refs/heads/master' &&
format('{0}/{1}', github.run_id, github.run_attempt) )
||
format('{0}/{1}', github.workflow, github.ref) }}
cancel-in-progress: true
env:
IMAGE_NAME: ghcr.io/nilfoundation/proof-market-toolchain
jobs:
build-image:
runs-on: [ self-hosted, aws_autoscaling ]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: dorny/paths-filter@v2
id: changes
with:
filters: .github/filters.yml
# If the base image didn't change, use one from registry
- name: Pull ${{ env.IMAGE_NAME }}:base
if: steps.changes.outputs.dockerfile-base == 'false'
run: docker pull ${{ env.IMAGE_NAME }}:base || true
# If the base image has changed, build it from scratch
- name: Rebuild ${{ env.IMAGE_NAME }}:base
if: steps.changes.outputs.dockerfile-base == 'true'
run: docker build -t ${{ env.IMAGE_NAME }}:base --file Dockerfile.base .
- name: Rebuild ${{ env.IMAGE_NAME }}:latest
run: docker build -t ${{ env.IMAGE_NAME }}:latest .