feat: 修改了构建脚本
Some checks failed
Build and Push Docker Image to Aliyun Registry / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Docker Image to Aliyun Registry / build-and-push (push) Has been cancelled
Signed-off-by: Caijinglong <cjl_spy@163.com>
This commit is contained in:
parent
d28d5e91d3
commit
453b38bbc9
44
.github/workflows/docker-build-push.yml
vendored
44
.github/workflows/docker-build-push.yml
vendored
@ -13,7 +13,8 @@ on:
|
||||
|
||||
env:
|
||||
REGISTRY: ${{ secrets.ALIYUN_REGISTRY }}
|
||||
IMAGE_NAME: ${{ secrets.IMAGE_NAME || github.repository }}
|
||||
IMAGE_NAME: ${{ secrets.IMAGE_NAME || 'common-nginx-fpm' }}
|
||||
NAMESPACE: ${{ secrets.ALIYUN_NAMESPACE }}
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
@ -50,10 +51,36 @@ jobs:
|
||||
org.opencontainers.image.title=Common Nginx PHP-FPM
|
||||
org.opencontainers.image.description=A common Nginx + PHP-FPM Docker image with Alpine Linux
|
||||
org.opencontainers.image.vendor=Common Docker Images
|
||||
|
||||
- name: Debug registry information
|
||||
run: |
|
||||
echo "Registry: ${{ env.REGISTRY }}"
|
||||
echo "Image Name: ${{ env.IMAGE_NAME }}"
|
||||
echo "Full Image: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}"
|
||||
echo "Generated Tags:"
|
||||
echo "${{ steps.meta.outputs.tags }}"
|
||||
|
||||
- name: Build and push Docker image
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
id: build
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: false
|
||||
load: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: linux/amd64
|
||||
cache-from: |
|
||||
type=gha
|
||||
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
|
||||
cache-to: |
|
||||
type=gha,mode=max
|
||||
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
|
||||
|
||||
- name: Push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
id: push
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
@ -61,11 +88,16 @@ jobs:
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: linux/amd64
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
cache-from: |
|
||||
type=gha
|
||||
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.build.outputs.digest }}
|
||||
- name: Build and Push Results
|
||||
run: |
|
||||
echo "✅ Build completed successfully!"
|
||||
echo "Build digest: ${{ steps.build.outputs.digest }}"
|
||||
echo "✅ Push completed successfully!"
|
||||
echo "Push digest: ${{ steps.push.outputs.digest }}"
|
||||
|
||||
- name: Update deployment status
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
logs/
|
||||
Loading…
x
Reference in New Issue
Block a user