Basic repository files added

This commit is contained in:
Paramtamtam
2020-07-11 00:03:52 +05:00
commit 9577d9c925
9 changed files with 328 additions and 0 deletions

28
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: release
on:
release: # Docs: <https://git.io/JeBz1#release-event-release>
types: [published]
jobs:
docker-image:
name: Build docker image
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Generate image tag value
run: echo "::set-env name=IMAGE_TAG::${GITHUB_REF##*/[vV]}" # `/refs/tags/v1.2.3` -> `1.2.3`
- name: Make docker login
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_LOGIN }}" --password-stdin &> /dev/null
- name: Build image
run: docker build --tag "tarampampam/3proxy:${IMAGE_TAG}" --tag "tarampampam/3proxy:latest" -f ./Dockerfile .
- name: Push version image
run: docker push "tarampampam/3proxy:${IMAGE_TAG}"
- name: Push latest image
run: docker push "tarampampam/3proxy:latest"

52
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: tests
on:
push:
branches:
- master
tags-ignore:
- '**'
pull_request:
schedule:
- cron: '0 0 * * 0' # once in a week, docs: <https://git.io/JvxXE#onschedule>
jobs: # Docs: <https://git.io/JvxXE>
docker-image:
name: Build and use docker image
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build docker image
run: docker build -f ./Dockerfile --tag image:local .
- name: Run docker image with default settings
run: docker run --rm -d -p "3128:3128/tcp" -p "1080:1080/tcp" image:local
- name: Pause
run: sleep 2
- name: Try to use HTTP proxy
run: curl -v --fail --proxy http://127.0.0.1:3128 --connect-timeout 3 --max-time 3 https://github.com/robots.txt
- name: Try to use SOCKS proxy
run: curl -v --fail --proxy socks5://127.0.0.1:1080 --connect-timeout 3 --max-time 3 https://github.com/robots.txt
- name: Stop container
run: docker stop $(docker ps -a --filter ancestor=image:local -q)
- name: Run docker image with auth settings
run: docker run --rm -d -p "3128:3128/tcp" -p "1080:1080/tcp" -e "AUTH_REQUIRED=true" -e "PROXY_LOGIN=evil" -e "PROXY_PASSWORD=live" image:local
- name: Pause
run: sleep 2
- name: Try to use HTTP proxy
run: curl -v --fail --proxy http://127.0.0.1:3128 --proxy-user evil:live --connect-timeout 3 --max-time 3 https://github.com/robots.txt
- name: Try to use SOCKS proxy
run: curl -v --fail --proxy socks5://127.0.0.1:1080 --proxy-user evil:live --connect-timeout 3 --max-time 3 https://github.com/robots.txt
- name: Stop container
run: docker stop $(docker ps -a --filter ancestor=image:local -q)