Make build cross-platform
This commit is contained in:
parent
5de34b68d8
commit
f1ac1c6af0
@ -1,4 +1,4 @@
|
|||||||
name: Build and Push Docker Image
|
name: Build and Push Backend Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -24,32 +24,30 @@ jobs:
|
|||||||
ls -la src/modules/redis
|
ls -la src/modules/redis
|
||||||
|
|
||||||
- name: Login to Registry
|
- name: Login to Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: gitea.spilum.net
|
registry: gitea.spilum.net
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Build Docker Image
|
- name: Set SHORT_SHA
|
||||||
env:
|
id: vars
|
||||||
BRANCH_NAME: ${{ github.ref_name }}
|
run: echo "short_sha=${GITHUB_SHA::5}" >> "$GITHUB_OUTPUT"
|
||||||
SHORT_HASH: ${{ github.sha }}
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
--build-arg BUILD_IDENTIFIER=${SHORT_HASH:0:5} \
|
|
||||||
-t gitea.spilum.net/spilum.net/mtf-backend:${BRANCH_NAME}-${SHORT_HASH:0:5} .
|
|
||||||
|
|
||||||
docker tag \
|
- name: Set up Docker Buildx
|
||||||
gitea.spilum.net/spilum.net/mtf-backend:${BRANCH_NAME}-${SHORT_HASH:0:5} \
|
uses: docker/setup-buildx-action@v3
|
||||||
gitea.spilum.net/spilum.net/mtf-backend:${BRANCH_NAME}-latest
|
|
||||||
|
|
||||||
- name: Push Docker Image
|
- name: Build and Push Backend (multi-arch)
|
||||||
env:
|
uses: docker/build-push-action@v6
|
||||||
BRANCH_NAME: ${{ github.ref_name }}
|
with:
|
||||||
SHORT_HASH: ${{ github.sha }}
|
context: .
|
||||||
run: |
|
push: true
|
||||||
docker push gitea.spilum.net/spilum.net/mtf-backend:${BRANCH_NAME}-${SHORT_HASH:0:5}
|
platforms: linux/amd64,linux/arm64
|
||||||
docker push gitea.spilum.net/spilum.net/mtf-backend:${BRANCH_NAME}-latest
|
build-args: |
|
||||||
|
BUILD_IDENTIFIER=${{ steps.vars.outputs.short_sha }}
|
||||||
|
tags: |
|
||||||
|
gitea.spilum.net/spilum.net/mtf-backend:${{ github.ref_name }}-${{ steps.vars.outputs.short_sha }}
|
||||||
|
gitea.spilum.net/spilum.net/mtf-backend:${{ github.ref_name }}-latest
|
||||||
|
|
||||||
- name: Log out from registry
|
- name: Log out from registry
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user