Refactor Docker workflow to remove Node.js installation and streamline image build and push steps
Build And Push Image / docker (push) Failing after 4s Details

This commit is contained in:
Matt 2025-08-06 15:59:44 +02:00
parent 0e9aaa90f1
commit 902f36ee12
1 changed files with 18 additions and 24 deletions

View File

@ -4,33 +4,27 @@ on: [push]
jobs:
docker:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Install Node.js
run: |
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
node --version
npm --version
- name: Checkout Repository
uses: actions/checkout@v4
- 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: Login To Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY_HOST }}
username: ${{ vars.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build Docker Image
run: |
docker build -t ${{ vars.REGISTRY_HOST }}/${{ vars.REGISTRY_USERNAME }}/containers/${{ vars.IMAGE_NAME }}:latest .
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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
- 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