Compare commits

..

3 Commits

Author SHA1 Message Date
86784bfc18 Add Multi-Arch build workflow for gitea
Some checks failed
Multi-Arch Build / docker (release) Failing after 6s
2025-01-03 12:13:07 -05:00
747d976f78 Update gitea workflow for native builds 2025-01-03 12:09:33 -05:00
a8360b2492 Add Multi-Arch build workflow for github 2025-01-03 11:52:26 -05:00
3 changed files with 70 additions and 15 deletions

View 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 }}

View File

@ -3,10 +3,7 @@ name: Generic Build
on:
push:
tags:
- 'v*'
tags-ignore:
- 'v*-arm64'
- 'v*-amd64'
- 'v*-native'
jobs:
docker:
@ -15,6 +12,10 @@ jobs:
- name: Checkout code
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
uses: docker/setup-buildx-action@v3
@ -32,4 +33,4 @@ jobs:
push: true
tags: |
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 }}

View File

@ -1,4 +1,4 @@
name: Build and Publish Docker Image
name: Build and Publish Docker Image (Multi-Arch)
on:
release:
@ -11,13 +11,15 @@ env:
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
- name: Checkout code
uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} .
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
@ -25,8 +27,13 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Push Docker image to Docker Hub
run: |
docker push ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
docker tag ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} ${{ env.IMAGE_NAME }}:latest
docker push ${{ env.IMAGE_NAME }}:latest
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}