Skip to content

Commit 5437a7e

Browse files
author
Test User
committed
Add docker builder script
1 parent 19ec117 commit 5437a7e

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/build-docker.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and Push Docker Image
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ '*' ]
7+
paths:
8+
- '.github/scripts/docker/Dockerfile'
9+
- '.github/workflows/build-docker.yml'
10+
pull_request:
11+
branches: [ '*' ]
12+
paths:
13+
- '.github/scripts/docker/Dockerfile'
14+
- '.github/workflows/build-docker.yml'
15+
workflow_dispatch:
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
# END OF COMMON SECTION
21+
22+
jobs:
23+
build-and-push:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
packages: write
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Log in to GitHub Container Registry
34+
uses: docker/login-action@v3
35+
with:
36+
registry: ghcr.io
37+
username: ${{ github.actor }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Extract metadata for Docker
41+
id: meta
42+
uses: docker/metadata-action@v5
43+
with:
44+
images: ghcr.io/${{ github.repository_owner }}/build-wolfprovider-debian
45+
tags: |
46+
type=raw,value=bookworm
47+
type=raw,value=latest
48+
49+
- name: Build and push Docker image
50+
uses: docker/build-push-action@v5
51+
with:
52+
context: .
53+
file: .github/scripts/docker/Dockerfile
54+
push: true
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)