Skip to content

Commit

Permalink
test: rewrite stable docker image build
Browse files Browse the repository at this point in the history
  • Loading branch information
Markson Hon committed Nov 12, 2023
1 parent d3fdacb commit 4af410d
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 49 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/dockerimage.yml

This file was deleted.

58 changes: 55 additions & 3 deletions .github/workflows/release_main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build & Release v2rayA

on:
workflow_dispatch:
push:
Expand Down Expand Up @@ -676,17 +677,17 @@ jobs:
version=${tag:1}
echo "VERSION=$version" >> $GITHUB_OUTPUT
echo "VERSION=$version" >> $GITHUB_ENV
- name: Download Artifacts Linux x64
- name: Download Artifact Linux x64
uses: actions/download-artifact@v3
with:
name: v2raya_linux_x64_${{ steps.prep.outputs.VERSION }}
path: Downloads
- name: Download Artifacts macOS x64
- name: Download Artifact macOS x64
uses: actions/download-artifact@v3
with:
name: v2raya_darwin_x64_${{ steps.prep.outputs.VERSION }}
path: Downloads
- name: Download Artifacts macOS arm64
- name: Download Artifact macOS arm64
uses: actions/download-artifact@v3
with:
name: v2raya_darwin_arm64_${{ steps.prep.outputs.VERSION }}
Expand All @@ -713,3 +714,54 @@ jobs:
v2raya-x86_64-linux.zip v2raya-x86_64-linux.zip.sha256.txt \
v2raya-x86_64-macos.zip v2raya-x86_64-macos.zip.sha256.txt \
v2raya-aarch64-macos.zip v2raya-aarch64-macos.zip.sha256.txt
Release_to_Docker:
runs-on: ubuntu-22.04
needs: [Build_v2rayA_Binaries]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check Version
id: prep
run: |
echo "P_DIR=$(pwd)" >> $GITHUB_OUTPUT
tag=$(git describe --tags $(git rev-list --tags --max-count=1))
version=${tag:1}
echo "VERSION=$version" >> $GITHUB_OUTPUT
echo "VERSION=$version" >> $GITHUB_ENV
TAG=$(echo $GITHUB_REF | cut -d / -f 3)
IMAGE="mzz2017/v2raya"
echo image=${IMAGE} >> $GITHUB_OUTPUT
echo tag=${TAG:1} >> $GITHUB_OUTPUT
- name: Download Artifact Linux x64
uses: actions/download-artifact@v3
with:
name: v2raya_linux_x64_${{ steps.prep.outputs.VERSION }}
path: Downloads
- name: Download Artifact Linux arm64
uses: actions/download-artifact@v3
with:
name: v2raya_linux_arm64_${{ steps.prep.outputs.VERSION }}
path: Downloads
- name: Download Artifact Linux armv7
uses: actions/download-artifact@v3
with:
name: v2raya_linux_armv7_${{ steps.prep.outputs.VERSION }}
path: Downloads
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker Images
shell: bash
run: |
Current_Path=$(pwd)
mkdir build_docker && cd build_docker && mkdir build
cat $Current_Path/install/docker/Dockerfile.Action | sed s/Real_v2rayA_PATH/$Current_Path/Downloads/v2raya_linux_x64_${{ steps.prep.outputs.VERSION }}/g > Dockerfile.Action_x64
docker buildx build --platform linux/amd64 -f Dockerfile.Action_x64 -t $IMAGE:$TAG ./build
7 changes: 7 additions & 0 deletions install/docker/Dockerfile.Action
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM alpine:latest
RUN apk add --no-cache iptables ip6tables nftables
COPY Real_v2rayA_PATH /usr/bin/v2raya
CMD [“/usr/bin/v2raya”]
EXPOSE 2017
VOLUME /etc/v2raya
ENTRYPOINT ["v2raya"]

0 comments on commit 4af410d

Please sign in to comment.