File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments