Compare commits
3 Commits
3dce43f0be
...
86784bfc18
Author | SHA1 | Date | |
---|---|---|---|
86784bfc18 | |||
747d976f78 | |||
a8360b2492 |
47
.gitea/workflows/multi-arch.yml
Normal file
47
.gitea/workflows/multi-arch.yml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
name: Multi-Arch Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Read version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
VERSION=$(node -p "require('./package.json').version")
|
||||||
|
BUILD_VERSION="${VERSION}.${GITHUB_RUN_NUMBER}"
|
||||||
|
echo "build_version=${BUILD_VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
buildkitd-flags: --allow-insecure-entitlement network.host
|
||||||
|
|
||||||
|
- name: Login to Private Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: dcr.behzadan.com
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
build-args: |
|
||||||
|
NODE_ENV=production
|
||||||
|
tags: |
|
||||||
|
dcr.behzadan.com/reza/wireguard-3proxy:latest
|
||||||
|
dcr.behzadan.com/reza/wireguard-3proxy:${{ steps.version.outputs.BUILD_VERSION }}
|
||||||
|
|
@ -3,10 +3,7 @@ name: Generic Build
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*-native'
|
||||||
tags-ignore:
|
|
||||||
- 'v*-arm64'
|
|
||||||
- 'v*-amd64'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
@ -15,6 +12,10 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Extract version
|
||||||
|
id: version
|
||||||
|
run: echo "VERSION=$(echo ${{ gitea.ref_name }} | sed 's/-native//')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
@ -32,4 +33,4 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
dcr.behzadan.com/reza/wireguard-3proxy:latest
|
dcr.behzadan.com/reza/wireguard-3proxy:latest
|
||||||
dcr.behzadan.com/reza/wireguard-3proxy:${{ gitea.ref_name }}
|
dcr.behzadan.com/reza/wireguard-3proxy:${{ steps.version.outputs.VERSION }}
|
||||||
|
27
.github/workflows/build-and-push.yaml
vendored
27
.github/workflows/build-and-push.yaml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Build and Publish Docker Image
|
name: Build and Publish Docker Image (Multi-Arch)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
@ -11,13 +11,15 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-publish:
|
build-and-publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Set up QEMU
|
||||||
run: docker build -t ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} .
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
@ -25,8 +27,13 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
- name: Push Docker image to Docker Hub
|
- name: Build and push
|
||||||
run: |
|
uses: docker/build-push-action@v5
|
||||||
docker push ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
with:
|
||||||
docker tag ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} ${{ env.IMAGE_NAME }}:latest
|
context: .
|
||||||
docker push ${{ env.IMAGE_NAME }}:latest
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.IMAGE_NAME }}:latest
|
||||||
|
${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user