Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
JessThrysoee committed Feb 12, 2024
1 parent d503594 commit c241f60
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 46 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Push Docker Image

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Lowercase repo name
run: echo "GITHUB_REPOSITORY_LOWERCASE=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/${{ env.GITHUB_REPOSITORY_LOWERCASE }}/git-registry:${{github.ref_name}}
ghcr.io/${{ env.GITHUB_REPOSITORY_LOWERCASE }}/git-registry:latest
thrysoee/git-registry:${{github.ref_name}}
thrysoee/git-registry:latest
41 changes: 0 additions & 41 deletions Makefile.build

This file was deleted.

1 change: 0 additions & 1 deletion VERSION

This file was deleted.

7 changes: 3 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: "3.9"
---

services:

git-registry:
image: thrysoee/git-registry:${GIT_REGISTRY_VERSION:-latest}
container_name: git-registry
Expand All @@ -19,6 +18,6 @@ services:
restart: unless-stopped

volumes:
git-registry-etc-ssh-volume:
git-registry-repositories-volume:
git-registry-etc-ssh-volume: ~
git-registry-repositories-volume: ~

0 comments on commit c241f60

Please sign in to comment.