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