ci: use docker cli for image publish
Some checks failed
Publish Docker image / publish (push) Failing after 3m26s
Some checks failed
Publish Docker image / publish (push) Failing after 3m26s
This commit is contained in:
parent
b332b26752
commit
304a6290c8
1 changed files with 20 additions and 18 deletions
|
|
@ -17,25 +17,27 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Install Docker CLI
|
||||||
uses: docker/setup-buildx-action@v3
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y docker.io
|
||||||
|
|
||||||
- name: Log in to Forgejo registry
|
- name: Log in to Forgejo registry
|
||||||
uses: docker/login-action@v3
|
run: |
|
||||||
with:
|
printf '%s' "${{ secrets.FORGEJO_REGISTRY_TOKEN }}" \
|
||||||
registry: ${{ env.REGISTRY }}
|
| docker login "${REGISTRY}" \
|
||||||
username: ${{ secrets.FORGEJO_REGISTRY_USERNAME }}
|
--username "${{ secrets.FORGEJO_REGISTRY_USERNAME }}" \
|
||||||
password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
|
--password-stdin
|
||||||
|
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
uses: docker/build-push-action@v6
|
run: |
|
||||||
with:
|
IMAGE_TAG="${REGISTRY}/${IMAGE_NAME}:${{ github.ref_name }}"
|
||||||
context: .
|
docker build \
|
||||||
file: prod.Dockerfile
|
--file prod.Dockerfile \
|
||||||
target: aio
|
--target aio \
|
||||||
push: true
|
--label "org.opencontainers.image.source=https://${REGISTRY}/${IMAGE_NAME}" \
|
||||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
|
--label "org.opencontainers.image.revision=${{ github.sha }}" \
|
||||||
labels: |
|
--label "org.opencontainers.image.version=${{ github.ref_name }}" \
|
||||||
org.opencontainers.image.source=https://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
--tag "${IMAGE_TAG}" \
|
||||||
org.opencontainers.image.revision=${{ github.sha }}
|
.
|
||||||
org.opencontainers.image.version=${{ github.ref_name }}
|
docker push "${IMAGE_TAG}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue