Skip to content

Modify yml build

Modify yml build #1

name: DocSpace services build and push
on:
push:
branches:
- 'hotfix/v*'
- 'release/v*'
- 'develop'
paths:
- '.github/workflows/docker-build-test.yml'
workflow_dispatch:
env:
DOCKER_PATH: "/docker"
REPO: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_IMAGE_PREFIX: "4testing-docspace"
DOCKERFILE: "./docker/Dockerfile.app"
DOCKER_TAG: develop
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Free Disk Space
run: |
sudo rm -rf /usr/local/lib/android /opt/ghc
sudo docker image prune --all --force
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build 4testing
id: build
run: |
cd .${DOCKER_PATH}
DOCKER_TAG=develop.${{ github.run_number }}
export DOCKER_TAG
ls -la
df -h
pwd
# docker buildx build . -f "Dockerfile.app" -t sk81biz/4testing-docspace-file-services:1.0.1 --build-arg GIT_BRANCH="develop"\
# --platform=${{ matrix.platform }} --target src-test --push
# echo "version=${DOCKER_TAG}" >> "$GITHUB_OUTPUT"
shell: bash
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
push: true
target: src-test
file: ${{ env.DOCKERFILE }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/4testing-docspace-src:${{ env.DOCKER_TAG }}
build-args: GIT_BRANCH=develop
# docker buildx bake -f build.yml \
# --set *.args.GIT_BRANCH=${{ github.GITHUB_REF_NAME }} \
# --set *.args.PRODUCT_VERSION=${PRODUCT_VERSION} \
# --set *.args.BUILD_NUMBER=${BUILD_NUMBER} \
# --set *.platform=${{ matrix.platform }} \
# --set *.platform=${{ matrix.platform }} \
# --set *.args.PRODUCT_VERSION=${PRODUCT_VERSION} \
# --set *.args.BUILD_NUMBER=${{github.run_number}} \
# --push
# echo "version=${DOCKER_TAG}" >> "$GITH