|
1 | 1 | name: Docker Build and Publish |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: [master] |
6 | | - tags: ["v*.*.*"] |
7 | | - pull_request: |
8 | | - branches: [master] |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + tags: ["v*.*.*"] |
| 7 | + pull_request: |
| 8 | + branches: [master] |
9 | 9 |
|
10 | 10 | env: |
11 | | - REGISTRY: ghcr.io |
12 | | - IMAGE_NAME: ${{ github.repository }} |
| 11 | + REGISTRY: ghcr.io |
| 12 | + IMAGE_NAME: ${{ github.repository }} |
13 | 13 |
|
14 | 14 | jobs: |
15 | | - build-and-push: |
16 | | - runs-on: ubuntu-latest |
17 | | - permissions: |
18 | | - contents: read |
19 | | - packages: write |
| 15 | + build-and-push: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + permissions: |
| 18 | + contents: read |
| 19 | + packages: write |
20 | 20 |
|
21 | | - steps: |
22 | | - - name: Checkout repository |
23 | | - uses: actions/checkout@v6.0.2 |
| 21 | + steps: |
| 22 | + - name: Checkout repository |
| 23 | + uses: actions/checkout@v6.0.2 |
24 | 24 |
|
25 | | - - name: Log in to GitHub Container Registry |
26 | | - uses: docker/login-action@v3.7.0 |
27 | | - with: |
28 | | - registry: ${{ env.REGISTRY }} |
29 | | - username: ${{ github.actor }} |
30 | | - password: ${{ secrets.GITHUB_TOKEN }} |
| 25 | + - name: Log in to GitHub Container Registry |
| 26 | + uses: docker/login-action@v3.7.0 |
| 27 | + with: |
| 28 | + registry: ${{ env.REGISTRY }} |
| 29 | + username: ${{ github.actor }} |
| 30 | + password: ${{ secrets.GITHUB_TOKEN }} |
31 | 31 |
|
32 | | - - name: Extract metadata for Docker |
33 | | - id: meta |
34 | | - uses: docker/metadata-action@v5.10.0 |
35 | | - with: |
36 | | - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
37 | | - tags: | |
38 | | - type=ref,event=branch |
39 | | - type=ref,event=pr |
40 | | - type=semver,pattern={{version}} |
41 | | - type=semver,pattern={{major}}.{{minor}} |
42 | | - type=sha |
| 32 | + - name: Extract metadata for Docker |
| 33 | + id: meta |
| 34 | + uses: docker/metadata-action@v5.10.0 |
| 35 | + with: |
| 36 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 37 | + tags: | |
| 38 | + type=ref,event=branch |
| 39 | + type=ref,event=pr |
| 40 | + type=semver,pattern={{version}} |
| 41 | + type=semver,pattern={{major}}.{{minor}} |
| 42 | + type=sha |
43 | 43 |
|
44 | | - - name: Build and push Docker image |
45 | | - uses: docker/build-push-action@v6.18.0 |
46 | | - with: |
47 | | - context: . |
48 | | - push: ${{ github.event_name != 'pull_request' }} |
49 | | - tags: ${{ steps.meta.outputs.tags }} |
50 | | - labels: ${{ steps.meta.outputs.labels }} |
| 44 | + - name: Build and push Docker image |
| 45 | + uses: docker/build-push-action@v6.18.0 |
| 46 | + with: |
| 47 | + context: . |
| 48 | + push: ${{ github.event_name != 'pull_request' }} |
| 49 | + tags: ${{ steps.meta.outputs.tags }} |
| 50 | + labels: ${{ steps.meta.outputs.labels }} |
0 commit comments