|
9 | 9 | REGISTRY: ghcr.io
|
10 | 10 | IMAGE_NAME: ${{ github.repository }}
|
11 | 11 |
|
12 |
| -# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. |
13 | 12 | jobs:
|
14 | 13 | build-and-push-image:
|
15 | 14 | runs-on: ubuntu-latest
|
16 |
| - # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. |
17 | 15 | permissions:
|
18 | 16 | contents: read
|
19 | 17 | packages: write
|
20 |
| - # |
21 | 18 | steps:
|
22 | 19 | - name: Checkout repository
|
23 | 20 | uses: actions/checkout@v4
|
24 |
| - # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. |
| 21 | + - name: Set up QEMU |
| 22 | + uses: docker/setup-qemu-action@v3 |
| 23 | + - name: Set up Docker Buildx |
| 24 | + uses: docker/setup-buildx-action@v3 |
25 | 25 | - name: Log in to the Container registry
|
26 | 26 | uses: docker/login-action@v3
|
27 | 27 | with:
|
28 | 28 | registry: ${{ env.REGISTRY }}
|
29 | 29 | username: ${{ github.actor }}
|
30 | 30 | password: ${{ secrets.GITHUB_TOKEN }}
|
31 |
| - # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. |
32 | 31 | - name: Extract metadata (tags, labels) for Docker
|
33 | 32 | id: meta
|
34 | 33 | uses: docker/metadata-action@v5
|
35 | 34 | with:
|
36 | 35 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
37 |
| - # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. |
38 |
| - # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. |
39 |
| - # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. |
40 | 36 | - name: Build and push Docker image
|
41 | 37 | uses: docker/build-push-action@v6
|
42 | 38 | with:
|
|
0 commit comments