-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (65 loc) · 1.63 KB
/
image.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Image
# Put 'on' in quotes to avoid YAML parsing error
"on":
# Enable manual triggering
workflow_dispatch: {}
# Run on commits to main branch
push:
branches:
- main
# Run only on changes to relevant files
paths:
- .github/workflows/image.yaml
- plugins/**
- scripts/**
- src/**
- .dockerignore
- .env.python
- Dockerfile
- flake.lock
- "*.nix"
- poetry.lock
- poetry.toml
- pyproject.toml
# Run also on pull requests to main branch
pull_request:
branches:
- main
# Run only on changes to relevant files
paths:
- .github/workflows/image.yaml
- plugins/**
- scripts/**
- src/**
- .dockerignore
- .env.python
- Dockerfile
- flake.lock
- "*.nix"
- poetry.lock
- poetry.toml
- pyproject.toml
jobs:
image:
name: Build Docker image
# Pin version of Ubuntu to avoid breaking changes
runs-on: ubuntu-22.04
# Use reasonable timeout to avoid stuck workflows
timeout-minutes: 30
permissions:
# Needed to checkout code
contents: read
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Build Docker image
uses: docker/[email protected]
with:
context: ./
# Don't save image
outputs: type=cacheonly
# Cache Docker layers between builds
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}