-
Notifications
You must be signed in to change notification settings - Fork 42
44 lines (44 loc) · 1.25 KB
/
docker-main.yaml
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: Populate docker cache
on:
push:
branches:
- main
# Use this branch for tests:
- docker-main-test
workflow_dispatch:
inputs:
network:
description: 'Network'
default: 'local'
type: string
no_cache:
description: 'no-cache'
required: true
default: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
builder:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
# We use `buildx` and its GitHub Actions caching support `type=gha`. For
# more information, see
# https://github.com/docker/build-push-action/issues/539
- name: Set up docker buildx
uses: docker/setup-buildx-action@v2
- name: Build docker artifacts
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
build-args: |
DFX_NETWORK=${{ inputs.network || 'local' }}
COMMIT=${{ github.sha }}
no-cache: ${{ inputs.no_cache || false }}
cache-from: type=gha,scope=cached-stage
cache-to: type=gha,scope=cached-stage,mode=max
outputs: type=cacheonly
target: scratch