|
1 | 1 | name: Continuous Delivery
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: |
6 |
| - - master |
7 |
| - tags: |
8 |
| - - '*.*.*' |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + tags: |
| 8 | + - '*.*.*' |
9 | 9 |
|
10 | 10 | concurrency:
|
11 |
| - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} |
12 |
| - cancel-in-progress: true |
| 11 | + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} |
| 12 | + cancel-in-progress: true |
13 | 13 |
|
14 | 14 | env:
|
15 |
| - REGISTRY: ghcr.io |
16 |
| - ORGANIZATION: ${{ github.repository_owner }} |
| 15 | + REGISTRY: ghcr.io |
| 16 | + ORGANIZATION: ${{ github.repository_owner }} |
17 | 17 |
|
18 | 18 | jobs:
|
19 |
| - build-and-push-image: |
20 |
| - name: Publish Docker Image |
21 |
| - permissions: |
22 |
| - contents: read |
23 |
| - packages: write |
24 |
| - runs-on: ubuntu-latest |
25 |
| - steps: |
26 |
| - - name: Checkout repository |
27 |
| - uses: actions/checkout@v3 |
| 19 | + build-and-push-image: |
| 20 | + name: Publish Docker Image |
| 21 | + permissions: |
| 22 | + contents: read |
| 23 | + packages: write |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + - name: Checkout repository |
| 27 | + uses: actions/checkout@v3 |
28 | 28 |
|
29 |
| - - name: Log in to the Container registry |
30 |
| - uses: docker/login-action@v2 |
31 |
| - with: |
32 |
| - registry: ${{ env.REGISTRY }} |
33 |
| - username: ${{ github.actor }} |
34 |
| - password: ${{ secrets.GITHUB_TOKEN }} |
| 29 | + - name: Log in to the Container registry |
| 30 | + uses: docker/login-action@v2 |
| 31 | + with: |
| 32 | + registry: ${{ env.REGISTRY }} |
| 33 | + username: ${{ github.actor }} |
| 34 | + password: ${{ secrets.GITHUB_TOKEN }} |
35 | 35 |
|
36 |
| - - name: Set up Docker Buildx |
37 |
| - id: buildx |
38 |
| - uses: docker/setup-buildx-action@v2 |
| 36 | + - name: Set up Docker Buildx |
| 37 | + id: buildx |
| 38 | + uses: docker/setup-buildx-action@v2 |
39 | 39 |
|
40 |
| - - name: Cache Docker layers |
41 |
| - |
42 |
| - with: |
43 |
| - path: /tmp/.buildx-cache |
44 |
| - key: ${{ runner.os }}-buildx-${{ github.sha }} |
45 |
| - restore-keys: | |
46 |
| - ${{ runner.os }}-buildx- |
| 40 | + - name: Cache Docker layers |
| 41 | + |
| 42 | + with: |
| 43 | + path: /tmp/.buildx-cache |
| 44 | + key: ${{ runner.os }}-buildx-${{ github.sha }} |
| 45 | + restore-keys: | |
| 46 | + ${{ runner.os }}-buildx- |
47 | 47 |
|
48 |
| - - name: Extract metadata (tags, labels) for Docker |
49 |
| - id: meta |
50 |
| - uses: docker/metadata-action@v4 |
51 |
| - with: |
52 |
| - images: ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/toolkit |
| 48 | + - name: Extract metadata (tags, labels) for Docker |
| 49 | + id: meta |
| 50 | + uses: docker/metadata-action@v4 |
| 51 | + with: |
| 52 | + images: ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/toolkit |
53 | 53 |
|
54 |
| - - name: Build and push |
55 |
| - uses: docker/build-push-action@v4 |
56 |
| - with: |
57 |
| - context: . |
58 |
| - file: ./Dockerfile |
59 |
| - push: true |
60 |
| - builder: ${{ steps.buildx.outputs.name }} |
61 |
| - tags: ${{ steps.meta.outputs.tags }}, ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/toolkit |
62 |
| - labels: ${{ steps.meta.outputs.labels }} |
63 |
| - cache-from: type=local,src=/tmp/.buildx-cache |
64 |
| - cache-to: type=local,dest=/tmp/.buildx-cache |
65 |
| - target: ${{ steps.environment.outputs.name }} |
| 54 | + - name: Build and push |
| 55 | + uses: docker/build-push-action@v4 |
| 56 | + with: |
| 57 | + context: . |
| 58 | + file: ./Dockerfile |
| 59 | + push: true |
| 60 | + builder: ${{ steps.buildx.outputs.name }} |
| 61 | + tags: ${{ steps.meta.outputs.tags }}, ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/toolkit |
| 62 | + labels: ${{ steps.meta.outputs.labels }} |
| 63 | + cache-from: type=local,src=/tmp/.buildx-cache |
| 64 | + cache-to: type=local,dest=/tmp/.buildx-cache |
| 65 | + target: ${{ steps.environment.outputs.name }} |
0 commit comments