-
Notifications
You must be signed in to change notification settings - Fork 1.6k
62 lines (53 loc) · 1.54 KB
/
docker-build-web.yml
File metadata and controls
62 lines (53 loc) · 1.54 KB
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
name: "Docker Build Web"
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag for the Docker image'
required: false
default: 'latest'
type: string
jobs:
build:
name: Build Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Create .env file
run: |
echo "WEB_URL=http://localhost:3000" > .env
echo "NEXT_PUBLIC_CAP_AWS_BUCKET=capso" >> .env
echo "NEXT_PUBLIC_CAP_AWS_REGION=us-east-1" >> .env
cat .env
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/capsoftware/cap-web
tags: |
type=raw,value=${{ inputs.tag || 'latest' }}
- name: Build Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: apps/web/Dockerfile
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
push: true
load: false
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Show Docker Images
run: docker images