Skip to content

Commit 2d6cb45

Browse files
committed
added automatic container updates every sunday so that openSSH stays up to date
1 parent 789b221 commit 2d6cb45

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

.github/workflows/autoupdate.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI for releases
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0' # every Sunday at midnight
6+
7+
jobs:
8+
build-and-push-docker-image:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
env:
14+
IMAGE_NAME: "reversed-ssh-tunnel" # can't contain uppercases
15+
steps:
16+
-
17+
name: Checkout repository
18+
uses: actions/checkout@v3
19+
-
20+
name: Set up QEMU
21+
uses: docker/setup-qemu-action@v2
22+
-
23+
name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v2
25+
-
26+
name: Login to GitHub Container Registry
27+
uses: docker/login-action@v2
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
-
33+
name: Login to DockerHub
34+
uses: docker/login-action@v2
35+
with:
36+
username: ${{ secrets.DOCKERHUB_USERNAME }}
37+
password: ${{ secrets.DOCKERHUB_TOKEN }}
38+
-
39+
name: Get latest tag
40+
id: latest_tag
41+
run: echo ::set-output name=tag::$(git describe --tags $(git rev-list --tags --max-count=1))
42+
-
43+
name: Extract metadata (tags, labels) for Docker
44+
id: meta
45+
uses: docker/metadata-action@v4
46+
with:
47+
images: |
48+
ghcr.io/${{ github.REPOSITORY_OWNER }}/${{ env.IMAGE_NAME }}
49+
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
50+
tags: |
51+
${{ steps.latest_tag.outputs.tag }}
52+
latest
53+
-
54+
name: Build and push
55+
uses: docker/build-push-action@v3
56+
with:
57+
context: .
58+
file: ./Dockerfile
59+
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
60+
push: true
61+
tags: ${{ steps.meta.outputs.tags }}
62+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ jobs:
4444
tags: |
4545
type=ref,event=branch
4646
type=semver,pattern={{version}}
47+
latest
48+
labels: |
49+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
50+
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}/blob/${{ github.sha }}/README.md
51+
4752
-
4853
name: Build and push
4954
uses: docker/build-push-action@v3

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ Create a lightweight Alpine Linux based SSH tunnel to a host. Uses pure SSH, no
66

77
FORKED FROM jujhars13/docker-ssh-tunnel but reversed the tunnel direction.
88

9+
## Advantages
10+
11+
- Stay up to date (with weekly builds that ensure that OpenSSH is up to date)
12+
13+
- Lightweight
14+
15+
- Easy to use
16+
17+
- No need to install anything on the host or the client
18+
919
## Required Parameters
1020

1121
| Variable | Description | default |

0 commit comments

Comments
 (0)