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:
|
||||
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 }}
|
||||
|
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:
|
||||
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 }}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user