Skip to content

Commit b5d8fe1

Browse files
committed
pre-build docker image
1 parent 693803e commit b5d8fe1

2 files changed

Lines changed: 47 additions & 3 deletions

File tree

.github/workflows/image.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build Image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- build/fpm.Dockerfile
8+
- .github/workflows/image.yml
9+
workflow_dispatch:
10+
11+
jobs:
12+
13+
build:
14+
15+
name: Build and push image
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 20
18+
19+
permissions:
20+
contents: read
21+
packages: write
22+
23+
steps:
24+
25+
- name: Checkout code
26+
uses: actions/checkout@v6
27+
28+
- name: Log in to GHCR
29+
uses: docker/login-action@v3
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Set up Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Build and push
39+
uses: docker/build-push-action@v6
40+
with:
41+
context: build
42+
file: build/fpm.Dockerfile
43+
push: true
44+
tags: ghcr.io/${{ github.repository_owner }}/fpm:latest

.github/workflows/package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
- name: Checkout code
2121
uses: actions/checkout@v6
2222

23-
- name: Build the Docker image
23+
- name: Pull the Docker image
2424
run: |
25-
cd build
26-
docker build . --tag fpm --file fpm.Dockerfile
25+
docker pull ghcr.io/${{ github.repository_owner }}/fpm:latest
26+
docker tag ghcr.io/${{ github.repository_owner }}/fpm:latest fpm
2727
2828
- name: Bundle packages
2929
run: |

0 commit comments

Comments
 (0)