Refactor Docker workflow to streamline image build and push steps
Build And Push Image / docker (push) Failing after 45s Details

This commit is contained in:
Matt 2025-08-06 15:53:31 +02:00
parent e0b9c5be68
commit 13eb09035f
1 changed files with 16 additions and 17 deletions

View File

@ -16,22 +16,21 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Login To Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY_HOST }}
username: ${{ vars.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Install Docker
run: |
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo usermod -aG docker $USER
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker Image
run: |
docker build -t ${{ vars.REGISTRY_HOST }}/${{ vars.REGISTRY_USERNAME }}/containers/${{ vars.IMAGE_NAME }}:latest .
- name: Build And Push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ vars.REGISTRY_HOST }}/${{ vars.REGISTRY_USERNAME }}/${{ vars.IMAGE_NAME }}:latest
- name: Login to Gitea Registry
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ vars.REGISTRY_HOST }} -u ${{ vars.REGISTRY_USERNAME }} --password-stdin
- name: Push Docker Image
run: |
docker push ${{ vars.REGISTRY_HOST }}/${{ vars.REGISTRY_USERNAME }}/containers/${{ vars.IMAGE_NAME }}:latest