Skip to content

Commit 3778979

Browse files
committed
try fix docker github action
1 parent 57d985b commit 3778979

1 file changed

Lines changed: 7 additions & 25 deletions

File tree

.github/workflows/docker.yaml

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,51 +17,33 @@ env:
1717

1818
jobs:
1919
build-and-push-image:
20-
runs-on: self-hosted
21-
timeout-minutes: 240 # wait up to 4 hours
22-
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
20+
runs-on: ubuntu-latest
2321
permissions:
2422
contents: read
2523
packages: write
26-
attestations: write
27-
id-token: write
24+
2825
steps:
2926
- name: Checkout repository
30-
uses: actions/checkout@v5
31-
# 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.
27+
uses: actions/checkout@v3
28+
3229
- name: Log in to the Container registry
3330
uses: docker/login-action@v2
3431
with:
3532
registry: ${{ env.REGISTRY }}
3633
username: ${{ github.actor }}
3734
password: ${{ secrets.GITHUB_TOKEN }}
38-
# 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.
35+
3936
- name: Extract metadata (tags, labels) for Docker
4037
id: meta
41-
uses: docker/metadata-action@v5
38+
uses: docker/metadata-action@v4
4239
with:
4340
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
44-
tags: |
45-
type=match,pattern=\d.\d.\d
46-
type=sha
47-
# 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.
48-
# 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.
49-
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
41+
5042
- name: Build and push Docker image
51-
id: push
5243
uses: docker/build-push-action@v4
5344
with:
5445
context: .
5546
push: true
5647
file: scripts/docker/dockerfile
57-
shm-size: 64g
5848
tags: ${{ steps.meta.outputs.tags }}
5949
labels: ${{ steps.meta.outputs.labels }}
60-
61-
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [Using artifact attestations to establish provenance for builds](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
62-
- name: Generate artifact attestation
63-
uses: actions/attest-build-provenance@v3
64-
with:
65-
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
66-
subject-digest: ${{ steps.push.outputs.digest }}
67-
push-to-registry: true

0 commit comments

Comments
 (0)