update build and script
All checks were successful
Weekly Docker Build / build (amd64) (push) Successful in 6m32s
All checks were successful
Weekly Docker Build / build (amd64) (push) Successful in 6m32s
This commit is contained in:
65
.gitea/workflows/arch-docker-node.yml
Normal file
65
.gitea/workflows/arch-docker-node.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
name: Weekly Docker Build
|
||||
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
- cron: '0 1 * * 0' # 01:00 sáng Chủ nhật (UTC)
|
||||
workflow_dispatch: # Cho phép chạy tay nếu cần
|
||||
|
||||
env:
|
||||
BASE_IMAGE_PATH: git.thuanle.me/public/base
|
||||
IMAGE: arch-docker-node
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
arch:
|
||||
- amd64
|
||||
runs-on: ${{ matrix.arch }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.thuanle.me
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build Docker images
|
||||
run: |
|
||||
echo "Building image ${{ env.IMAGE }} for architecture: ${{ matrix.arch }}"
|
||||
|
||||
docker build \
|
||||
-f ${{ env.IMAGE }}.${{ matrix.arch }}.Dockerfile \
|
||||
-t ${{ env.BASE_IMAGE_PATH }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest \
|
||||
--label "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
||||
--label "commit_sha=${{ github.sha }}" \
|
||||
.
|
||||
|
||||
docker push ${{ env.BASE_IMAGE_PATH }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest
|
||||
|
||||
# amend-manifest:
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: [build]
|
||||
# steps:
|
||||
# - name: Login to Docker Registry
|
||||
# uses: docker/login-action@v3
|
||||
# with:
|
||||
# registry: git.thuanle.me
|
||||
# username: ${{ secrets.DOCKER_USERNAME }}
|
||||
# password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
# - name: Push Docker manifest
|
||||
# run: |
|
||||
# echo "Delete existing manifest"
|
||||
# docker manifest rm ${{ env.BASE_IMAGE_PATH }}:latest || true
|
||||
|
||||
# echo "Create new manifest"
|
||||
# docker manifest create ${{ env.BASE_IMAGE_PATH }}:latest \
|
||||
# ${{ env.BASE_IMAGE_PATH }}:amd64-latest \
|
||||
# ${{ env.BASE_IMAGE_PATH }}:arm64-latest
|
||||
|
||||
# docker manifest push ${{ env.BASE_IMAGE_PATH }}:latest
|
||||
@@ -1,66 +0,0 @@
|
||||
name: Weekly Docker Build
|
||||
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
- cron: '0 1 * * 0' # 01:00 sáng Chủ nhật (UTC)
|
||||
workflow_dispatch: # Cho phép chạy tay nếu cần
|
||||
|
||||
env:
|
||||
IMAGE_PATH: git.thuanle.me/public/arch-node-docker
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
arch:
|
||||
- amd64
|
||||
- arm64
|
||||
runs-on: ${{ matrix.arch }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Fetch full history, keeping all commits
|
||||
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.thuanle.me
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build Docker images
|
||||
run: |
|
||||
echo "Building image for architecture: ${{ matrix.arch }}"
|
||||
|
||||
docker build \
|
||||
-t ${{ env.IMAGE_PATH }}:${{ matrix.arch }}-latest \
|
||||
--label "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
||||
--label "commit_sha=${{ github.sha }}" \
|
||||
.
|
||||
|
||||
docker push ${{ env.IMAGE_PATH }}:${{ matrix.arch }}-latest
|
||||
|
||||
amend-manifest:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build]
|
||||
steps:
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.thuanle.me
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Push Docker manifest
|
||||
run: |
|
||||
echo "Delete existing manifest"
|
||||
docker manifest rm ${{ env.IMAGE_PATH }}:latest || true
|
||||
|
||||
echo "Create new manifest"
|
||||
docker manifest create ${{ env.IMAGE_PATH }}:latest \
|
||||
${{ env.IMAGE_PATH }}:amd64-latest \
|
||||
${{ env.IMAGE_PATH }}:arm64-latest
|
||||
|
||||
docker manifest push ${{ env.IMAGE_PATH }}:latest
|
||||
Reference in New Issue
Block a user