forked from serjs/socks5-server
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 1.53 KB
/
main.yml
File metadata and controls
58 lines (56 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: "Latest tag from master branch"
env:
DOCKERHUB_REPOSITORY: ghcr.io/elecena/socks5-server:latest
PROXY_USER: foobar
PROXY_PASSWORD: s3cr3t
on:
pull_request:
branches: master
push:
branches: master
release:
types: [published, edited]
jobs:
hadolint:
name: hadolint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: hadolint
uses: hadolint/hadolint-action@v3.3.0
with:
ignore: DL3018
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v6
-
id: meta
uses: docker/metadata-action@v6
with:
images: elecena/socks5-server
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{raw}}
-
name: Run docker build
run: docker build --tag ${DOCKERHUB_REPOSITORY} .
-
name: Show docker images
run: docker images
-
name: Start and use the container
run: |
set -x
docker run -e PROXY_USER -e PROXY_PASSWORD -d --name=socks5 --rm --publish=31080:1080 ${DOCKERHUB_REPOSITORY}
sleep 3
docker ps
curl --ipv4 --proxy "socks5://${PROXY_USER}:${PROXY_PASSWORD}@0.0.0.0:31080" -vI -H "user-agent: socks5/healthcheck" http://example.com/
-
name: Print logs
if: always()
run: docker logs socks5