Repository navigation
138 lines (119 loc) · 4.29 KB
/
Copy pathdatabase-release.yml
File metadata and controls
138 lines (119 loc) · 4.29 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Aether Identity Database Release
on:
push:
tags: ["v*.*.*-prisma"]
workflow_dispatch:
inputs:
version:
description: "Version to build (e.g., 1.0.0)"
required: true
type: string
env:
REGISTRY: ghcr.io
IMAGE_NAME: skygenesisenterprise/aether-identity/prisma
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
package_version: ${{ steps.version.outputs.package_version }}
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Extract version from tag
id: version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
INPUT_VERSION="${{ github.event.inputs.version }}"
CLEAN_VERSION="${INPUT_VERSION%-prisma}"
VERSION="v${CLEAN_VERSION#v}"
PACKAGE_VERSION="${VERSION#v}"
else
TAG="${{ github.ref_name }}"
CLEAN_VERSION="${TAG%-prisma}"
VERSION="${CLEAN_VERSION}"
PACKAGE_VERSION="${CLEAN_VERSION#v}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
- name: Verify Dockerfile exists
run: |
if [ -f "prisma/infra/Dockerfile" ]; then
echo "✅ Dockerfile found at prisma/infra/Dockerfile"
else
echo "❌ No Dockerfile found at prisma/infra/Dockerfile"
exit 1
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ steps.version.outputs.version }}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@2ca78c6bec76527009825f31aae0532b4d40d820 # v6.18.0
with:
context: ./prisma
file: ./prisma/infra/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
- name: Sign the published Docker image
env:
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: Aether Identity Prisma v${{ needs.build.outputs.package_version }}
body: |
## Aether Identity Prisma v${{ needs.build.outputs.package_version }}
🐳 **Docker Image**:
```
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.build.outputs.version }}
```
### Usage
```bash
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.build.outputs.version }}
```
This image contains:
- Prisma CLI with pnpm
- Generated Prisma Client
- Required dependencies for database operations
---
📦 **Made with ❤️ by [Sky Genesis Enterprise](https://skygenesisenterprise.com)**
draft: false
prerelease: false