Skip to content

Commit 1a4bf10

Browse files
authored
docker image build workflow (#600)
1 parent 4ba76a9 commit 1a4bf10

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Docker Build Web"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Tag for the Docker image'
8+
required: false
9+
default: 'latest'
10+
type: string
11+
12+
jobs:
13+
build:
14+
name: Build Docker Image
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
20+
steps:
21+
- name: Checkout Repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Login to GitHub Container Registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Prepare Docker Metadata
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ghcr.io/capsoftware/cap-web
39+
tags: |
40+
type=raw,value=${{ inputs.tag || 'latest' }}
41+
42+
- name: Build Docker Image
43+
uses: docker/build-push-action@v5
44+
with:
45+
context: .
46+
file: apps/web/Dockerfile
47+
platforms: linux/amd64
48+
tags: ${{ steps.meta.outputs.tags }}
49+
push: true
50+
load: false
51+
cache-from: type=gha
52+
cache-to: type=gha,mode=max
53+
54+
- name: Show Docker Images
55+
run: docker images
File renamed without changes.

0 commit comments

Comments
 (0)