name: Build Docker Linux x64

on:
  push:
    branches:
      #- main

jobs:
  build-docker-linux-x64:
    runs-on: [self-hosted, linux, arm64, linux64-docker, docker]
    steps:
      - name: Install packages
        run: apk add --no-cache git curl wget unzip bash nodejs npm docker

      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Build Linux x64 Docker Image
        run: docker buildx build --platform linux/amd64 -t couchlog-linux-x64 .

      - name: Save Docker Image as tar
        run: docker save -o CouchLog-Linux-x64-Docker-Image.tar couchlog-linux-x64

      - name: Upload Artifact
        uses: actions/upload-artifact@v3
        with:
          name: CouchLog-Linux-x64-Docker-Image
          path: CouchLog-Linux-x64-Docker-Image.tar
          if-no-files-found: error
          retention-days: 1