diff --git a/.gitea/workflows/create-and-push-image.yaml b/.gitea/workflows/create-and-push-image.yaml index 659f843..f78ed0b 100644 --- a/.gitea/workflows/create-and-push-image.yaml +++ b/.gitea/workflows/create-and-push-image.yaml @@ -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