Skip to content

Commit 3cb791d

Browse files
committed
feat: build postgresql with awscli installed
0 parents  commit 3cb791d

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish to Docker
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- develop
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Log in to GitHub Container Registry
22+
uses: docker/login-action@v2
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v2
30+
31+
- name: Extract repository name
32+
run: |
33+
repo_name="${GITHUB_REPOSITORY#*/}"
34+
repo_name_lowercase=$(echo "$repo_name" | tr '[:upper:]' '[:lower:]') # convert to lowercase
35+
echo "Repository name: $repo_name_lowercase"
36+
echo "REPO_NAME=$repo_name_lowercase" >> $GITHUB_ENV
37+
38+
- name: Build and push
39+
uses: docker/build-push-action@v4
40+
with:
41+
context: .
42+
file: ./Dockerfile
43+
push: true
44+
tags: ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}:latest

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM postgres:17-alpine
2+
3+
# Install AWS CLI
4+
RUN apk add --no-cache python3 py3-pip && \
5+
pip3 install --upgrade pip && \
6+
pip3 install awscli && \
7+
apk del python3 py3-pip

0 commit comments

Comments
 (0)