@@ -21,34 +21,40 @@ env:
# 构建 Job
jobs :
build :
runs-on : ubuntu-node22 # 如果host构建 : linux_amd64
runs-on : ubuntu-node22 # 如果host构建: linux_amd64
# container:
# image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/ghcr.io/catthehacker/ubuntu:act-latest
steps :
- name : Print system info 1
run : echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
- name : Print system info 2
run : echo " This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- name : Print system info 3
run : echo " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name : Print env
run : env
run : env && blkid
- name : Install dependencies
run : apt-get update &&
run : |
apt-get update &&
apt-get install -y gettext &&
apt-get install -y maven &&
apt-get install coreutils &&
apt-get update &&
apt-get install ca-certificates curl &&
install -m 0755 -d /etc/apt/keyrings &&
curl -fsSL https ://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc &&
chmod a+r /etc/apt/keyrings/docker.asc &&
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
$(. /etc/os-release && echo " ${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null &&
apt-get update &&
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
apt-get install -y sudo &&
apt-get install -y iptables &&
- name : Set up Docker
uses : http://139.9.216.111:3000/bamanker/setup-docker-action@v4
with :
version : type=archive,channel=stable,version=v27.4.0
daemon-config : |
{
"registry-mirrors":["https://docker.1ms.run"],
"dns": ["8.8.8.8", "114.114.114.114"]
}
- name : Generate maven config
uses : http://139.9.216.111:3000/bamanker/maven-settings-action@v3.1.0
with :
@@ -81,8 +87,6 @@ jobs:
run : |
echo "The app version is $APP_TAG" && echo "tag=$APP_TAG" >> $GITHUB_OUTPUT &&
echo "now workspace: ${{ github.workspace }}" &&
pwd &&
docker version
# 为其他配置文件注入环境变量
- name : Inject envVar
@@ -124,7 +128,12 @@ jobs:
env :
TAG : ${{ steps.set_envar.outputs.tag }}
run : |
docker buildx build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} --push .
ls &&
docker build --file Dockerfile --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} . &&
docker image ls
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
# ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} --push.
# uses: http://139.9.216.111:3000/bamanker/docker-build-push@v5
# with:
# context: .
## platforms: linux/amd64