/[LeafOK_CVS]/fenglin/.github/workflows/docker-publish.yml
ViewVC logotype

Contents of /fenglin/.github/workflows/docker-publish.yml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Mon Feb 9 02:35:04 2026 UTC (5 weeks, 2 days ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +4 -0 lines
Content type: application/yaml
Update workflow

1 # This workflow uses actions that are not certified by GitHub.
2 # They are provided by a third-party and are governed by
3 # separate terms of service, privacy policy, and support
4 # documentation.
5
6 # GitHub recommends pinning actions to a commit SHA.
7 # To get a newer version, you will need to update the SHA.
8 # You can also reference a tag or branch, but the action may change without warning.
9
10 name: Publish Docker image
11
12 on:
13 release:
14 types: [published]
15
16 concurrency:
17 group: ${{ github.workflow }}-${{ github.ref }}
18 cancel-in-progress: true
19
20 env:
21 DOCKERHUB_PLATFORMS: linux/amd64,linux/arm64
22 APACHE_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-apache
23 PHP_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-php
24
25 jobs:
26 push_to_registry:
27 name: Push Docker image to Docker Hub
28 runs-on: ubuntu-latest
29 permissions:
30 packages: write
31 contents: read
32 attestations: write
33 id-token: write
34 steps:
35 - name: Check out the repo
36 uses: actions/checkout@v5
37
38 - name: Log in to Docker Hub
39 uses: docker/login-action@v3
40 with:
41 username: ${{ secrets.DOCKERHUB_USERNAME }}
42 password: ${{ secrets.DOCKERHUB_TOKEN }}
43
44 - name: Set up QEMU
45 uses: docker/setup-qemu-action@v3
46
47 - name: Set up Docker Buildx
48 uses: docker/setup-buildx-action@v3
49
50 - name: Extract Docker metadata (apache)
51 id: meta-apache
52 uses: docker/metadata-action@v5
53 with:
54 images: ${{ env.APACHE_IMAGE }}
55
56 - name: Extract Docker metadata (php)
57 id: meta-php
58 uses: docker/metadata-action@v5
59 with:
60 images: ${{ env.PHP_IMAGE }}
61
62 - name: Build and push Docker image (apache)
63 id: push-apache
64 uses: docker/build-push-action@v5
65 with:
66 platforms: ${{ env.DOCKERHUB_PLATFORMS }}
67 context: .
68 file: ./Dockerfile/dockerfile.apache
69 push: true
70 provenance: true
71 sbom: true
72 tags: |
73 ${{ env.APACHE_IMAGE }}:${{ github.ref_name }}
74 ${{ env.APACHE_IMAGE }}:latest
75 ${{ steps.meta-apache.outputs.tags }}
76 labels: ${{ steps.meta-apache.outputs.labels }}
77 cache-from: type=gha # Pull cache from GitHub Actions cache
78 cache-to: type=gha,mode=max # Push cache to GitHub Actions cache
79
80 - name: Build and push Docker image (php)
81 id: push-php
82 uses: docker/build-push-action@v5
83 with:
84 platforms: ${{ env.DOCKERHUB_PLATFORMS }}
85 context: .
86 file: ./Dockerfile/dockerfile.php
87 push: true
88 provenance: true
89 sbom: true
90 tags: |
91 ${{ env.PHP_IMAGE }}:${{ github.ref_name }}
92 ${{ env.PHP_IMAGE }}:latest
93 ${{ steps.meta-php.outputs.tags }}
94 labels: ${{ steps.meta-php.outputs.labels }}
95 cache-from: type=gha # Pull cache from GitHub Actions cache
96 cache-to: type=gha,mode=max # Push cache to GitHub Actions cache

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1