Skip to content

Commit

Permalink
added github actions and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
amhoba committed Dec 21, 2024
1 parent 31ed31b commit c2ab634
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Build and Push

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
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: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest
type=sha,format=long
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ This repository provides a Docker image for a simple SSH server based on Alpine
- [Docker](https://www.docker.com/get-started) installed on your machine.
- Basic knowledge of Docker commands.

### How To Just Run

Just run the following commands to start using it right away (or move on to the next step to build it yourself):

```bash
docker pull ghcr.io/amhoba2014/lightweight-docker-ssh-server ;
docker run --rm -it -p 2222:22 ghcr.io/amhoba2014/lightweight-docker-ssh-server:latest ;
```

### Building the Docker Image

To build the Docker image, clone this repository and navigate to its directory:
Expand Down

0 comments on commit c2ab634

Please sign in to comment.