Skip to content

Commit

Permalink
Merge pull request #15 from testainers/dev
Browse files Browse the repository at this point in the history
Version 0.1.4.
  • Loading branch information
edufolly authored Feb 12, 2024
2 parents c4a1f85 + 6578fde commit ff168f8
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 13 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,46 @@ jobs:
contents: write
steps:
- name: Code Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get Version
run: |
VERSION=$(grep 'version:' version.yaml | cut -c 10-)
echo "TAGS=latest" >> $GITHUB_ENV
SUFFIX=""
VERSION=$(grep 'version:' version.yaml | cut -c 10-)$SUFFIX
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "REPO=$GITHUB_REPOSITORY" >> $GITHUB_ENV
echo "OWNER=$GITHUB_REPOSITORY_OWNER" >> $GITHUB_ENV
- name: Check if version is used
run: |
URL=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/latest
LATEST=$(curl --silent "$URL" | jq -r .name)
if [ "$LATEST" == "$VERSION" ]; then
echo "Version already used: v$VERSION"
URL=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/tags/${{ env.VERSION }}
echo "$URL"
CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
if [ "$CODE" != 404 ]; then
echo "Release '$VERSION' already exists. ($CODE)"
exit 1
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ env.OWNER }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Docker Build & Push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
push: true
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/386
tags: |
${{ env.REPO }}:${{ env.VERSION }}
${{ env.REPO }}:latest
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ jobs:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
alpine:
- 3.16
- 3.17
- 3.18
- 3.19
steps:
- name: Code Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install sshpass
env:
Expand All @@ -22,4 +29,6 @@ jobs:
sudo apt-get install sshpass -y
- name: Running Tests
env:
ALPINE_VERSION: ${{ matrix.alpine }}
run: ./test.sh
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.17
FROM alpine:${ALPINE_VERSION:-3.19}

RUN apk add --no-cache openssh sshpass

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
sshd-container
</h1>

[![BuildWithLove](https://img.shields.io/badge/%20built%20with-%20%E2%9D%A4-ff69b4.svg "build with love")](https://github.com/testainers/sshd-container/stargazers)
[![Docker Image Version](https://img.shields.io/docker/v/testainers/sshd-container)](https://hub.docker.com/r/testainers/sshd-container/tags)
[![Build With Love](https://img.shields.io/badge/%20built%20with-%20%E2%9D%A4-ff69b4.svg)](https://github.com/testainers/sshd-container/stargazers)
[![Version](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2Ftestainers%2Fsshd-container%2Freleases%2Flatest&query=%24.name&label=version&color=orange)](https://hub.docker.com/r/testainers/sshd-container/tags)
[![Licence](https://img.shields.io/github/license/testainers/sshd-container?color=blue)](https://github.com/testainers/sshd-container/blob/main/LICENCE)
[![Build](https://img.shields.io/github/actions/workflow/status/testainers/sshd-container/main.yml?branch=main)](https://github.com/testainers/sshd-container/releases/latest)

Expand Down
2 changes: 1 addition & 1 deletion version.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 0.1.3
version: 0.1.4

0 comments on commit ff168f8

Please sign in to comment.