CI: try fixing login and push
Build and Push Docker Image / build-and-push (push) Has been cancelled
Details
Build and Push Docker Image / build-and-push (push) Has been cancelled
Details
This commit is contained in:
parent
b86c108082
commit
1fa447348f
|
@ -14,25 +14,21 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ gitea.repository_owner }}
|
||||||
|
password: ${{ secrets.GITEA_TOKEN}}
|
||||||
|
|
||||||
- name: Build and Push Docker Image
|
- name: Build and Push Docker Image
|
||||||
run: |
|
uses: docker/build-push-action@v4
|
||||||
# Set your Docker registry and image name
|
with:
|
||||||
REGISTRY_NAME="git.kucharczyk.xyz/${DOCKER_USERNAME}/containers/gitea"
|
context: .
|
||||||
# Optionally, set a tag for your image (e.g., a commit SHA)
|
file: ./Dockerfile
|
||||||
#TAG="${{ gitea.sha }}"
|
push: true
|
||||||
TAG="latest"
|
tags: git.kucharczyk.xyz/${{ gitea.repository_owner }}/containers/gitea:latest
|
||||||
|
|
||||||
# Build the Docker image
|
|
||||||
docker buildx create --use
|
|
||||||
docker buildx build --file Dockerfile -t "${REGISTRY_NAME}:${TAG}" .
|
|
||||||
|
|
||||||
# Log in to the container registry (replace with your authentication method)
|
|
||||||
docker login -u "${{ gitea.repository_owner }}" -p "$DOCKER_PASSWORD" your-registry-url.com
|
|
||||||
|
|
||||||
# Push the image to the container registry
|
|
||||||
docker push "${REGISTRY_NAME}:${TAG}"
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOCKER_USERNAME: ${{ gitea.repository_owner }}
|
DOCKER_USERNAME: ${{ gitea.repository_owner }}
|
||||||
|
|
Reference in New Issue