Skip to content

Commit 3b0b323

Browse files
committed
update docker build
1 parent 068704f commit 3b0b323

File tree

1 file changed

+18
-39
lines changed

1 file changed

+18
-39
lines changed

.github/workflows/docker.yml

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,26 @@ name: Docker Build
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches:
6+
- main
7+
- develop
8+
- "feature/**"
9+
- "hotfix/**"
10+
tags:
11+
- "v*.*.*"
612
pull_request:
7-
branches: [ "main" ]
8-
9-
permissions:
10-
contents: read
13+
branches:
14+
- main
15+
- develop
1116

1217
jobs:
13-
docker-build:
14-
name: Docker Build Test
15-
runs-on: ubuntu-latest
16-
permissions:
17-
contents: read
18-
steps:
19-
- uses: actions/checkout@v4
20-
21-
- name: Set up Docker Buildx
22-
uses: docker/setup-buildx-action@v3
23-
24-
- name: Build Docker image
25-
uses: docker/build-push-action@v5
26-
with:
27-
context: .
28-
push: false
29-
load: true
30-
tags: template-rust:test
31-
cache-from: type=gha
32-
cache-to: type=gha,mode=max
33-
34-
- name: Test Docker image
35-
run: |
36-
docker run --rm template-rust:test --version || echo "Application does not support --version flag"
37-
docker run --rm template-rust:test --help
38-
39-
docker-compose:
40-
name: Docker Compose Validation
18+
docker:
4119
runs-on: ubuntu-latest
42-
permissions:
43-
contents: read
4420
steps:
45-
- uses: actions/checkout@v4
46-
47-
- name: Validate docker-compose.yml
48-
run: docker compose config > /dev/null
21+
- uses: pnstack/actions/docker-publish@main
22+
with:
23+
platforms: linux/amd64,linux/arm64
24+
dockerfile: Dockerfile
25+
context: .
26+
push_enabled: true
27+
registry: ghcr.io

0 commit comments

Comments
 (0)