Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit bf84cb8

Browse files
committed
init
0 parents  commit bf84cb8

File tree

11 files changed

+962
-0
lines changed

11 files changed

+962
-0
lines changed

.github/workflows/build_test.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build_Test
2+
3+
concurrency:
4+
group: build-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- main
11+
- dev
12+
paths-ignore:
13+
- '**.md'
14+
push:
15+
branches:
16+
- '*'
17+
- '!main'
18+
- '!dev'
19+
paths-ignore:
20+
- '**.md'
21+
22+
jobs:
23+
build:
24+
name: Test build docker image
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v3
29+
- name: Set up Docker Buildx
30+
id: buildx
31+
uses: docker/setup-buildx-action@v2
32+
with:
33+
install: true
34+
version: latest
35+
driver-opts: image=moby/buildkit:master
36+
- name: Build docker image
37+
run: |
38+
docker build .

.github/workflows/deploy.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Deploy
2+
concurrency:
3+
group: build-${{ github.ref }}
4+
cancel-in-progress: true
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- main
11+
- dev
12+
paths-ignore:
13+
- '**.md'
14+
schedule:
15+
- cron: '33 3 * * 1'
16+
17+
jobs:
18+
build:
19+
name: Build, tag, and publish Docker image
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Get branch
23+
run: |
24+
echo "GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
25+
- name: Set main docker image tag
26+
run: |
27+
if [[ "$i{{ env.GIT_BRANCH }}" == "main" ]] || [[ "${{ env.GIT_BRANCH }}" == "master" ]]; then
28+
echo "MAIN_DOCKER_TAG=latest" >> $GITHUB_ENV
29+
else
30+
echo "MAIN_DOCKER_TAG=${{ env.GIT_BRANCH }}" >> $GITHUB_ENV
31+
fi
32+
- name: remove docker from repo name
33+
run: |
34+
echo "IMAGE_NAME=$(echo ${{ github.repository }} | sed 's|^jee-r/docker-||g')" >> $GITHUB_ENV
35+
- name: crop SHA
36+
run: |
37+
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
38+
- name: print env
39+
run: echo $ENV
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
- name: Set up Docker Buildx
43+
id: buildx
44+
uses: docker/setup-buildx-action@v2
45+
with:
46+
install: true
47+
version: latest
48+
driver-opts: image=moby/buildkit:master
49+
- name: Login into DockerHub
50+
uses: docker/login-action@v2
51+
with:
52+
username: ${{ secrets.DOCKERHUB_USERNAME }}
53+
password: ${{ secrets.DOCKERHUB_TOKEN }}
54+
- name: Login into GitHub Container Registry
55+
uses: docker/login-action@v2
56+
with:
57+
registry: ghcr.io
58+
username: ${{ github.actor }}
59+
password: ${{ secrets.GITHUB_TOKEN }}
60+
- name: Build and Push
61+
uses: docker/build-push-action@v3
62+
with:
63+
context: .
64+
file: ./Dockerfile
65+
platforms: linux/amd64
66+
push: true
67+
tags: |
68+
ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }}
69+
ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}:${{ env.MAIN_DOCKER_TAG }}
70+
ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}:${{ env.GIT_BRANCH }}
71+
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }}
72+
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.MAIN_DOCKER_TAG }}
73+
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.GIT_BRANCH }}

.github/workflows/mirroring.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Mirroring to remote repos
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
mirroring:
10+
name: Mirror
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
- name: mirror to gitlab.com
18+
uses: jee-r/docker-git-mirror@v1
19+
with:
20+
remote_repo: "gitlab.com/jee-r/docker-proxy-socks.git"
21+
remote_repo_username: ${{ secrets.GITLAB_USER }}
22+
remote_repo_password: ${{ secrets.GITLAB_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data/
2+
config/
3+
docker-compose.[y|ya]ml
4+

Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM alpine:3.16
2+
3+
LABEL name="docker-tinyproxy" \
4+
maintainer="Jee [email protected]" \
5+
description="tinyproxy docker image" \
6+
url="https://github.com/jee-r/docker-tinyproxy" \
7+
org.label-schema.vcs-url="https://github.com/jee-r/docker-tinyproxy" \
8+
org.opencontainers.image.source="https://github.com/jee-r/docker-tinyproxy"
9+
10+
COPY rootfs /
11+
12+
RUN apk update && \
13+
apk upgrade --no-cache && \
14+
apk add --upgrade --no-cache \
15+
tinyproxy \
16+
curl && \
17+
chmod +x \
18+
/usr/local/bin/entrypoint.sh \
19+
/usr/local/bin/healthcheck.sh && \
20+
rm -rf /tmp/* /var/cache/apk/*
21+
22+
EXPOSE 8888
23+
VOLUME /config
24+
25+
HEALTHCHECK --interval=5m --timeout=60s --start-period=30s \
26+
CMD /usr/local/bin/healthcheck.sh || exit 1
27+
28+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

0 commit comments

Comments
 (0)