diff --git a/.github/workflows/.github-ci.yaml b/.github/workflows/.github-ci.yaml index 4cc259f..7fce44c 100644 --- a/.github/workflows/.github-ci.yaml +++ b/.github/workflows/.github-ci.yaml @@ -1,28 +1,42 @@ name: ci -on: push +on: + push: + workflow_dispatch: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-host steps: - - name: Login to Docker Hub + name: Repository meta + id: repository + run: | + registry=${{ github.server_url }} + registry=${registry##http*://} + echo "registry=${registry}" >> "$GITHUB_OUTPUT" + echo "registry=${registry}" + repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" + echo "repository=${repository}" >> "$GITHUB_OUTPUT" + echo "repository=${repository}" + - + name: Docker meta + uses: docker/metadata-action@v5 + id: docker + with: + images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }} + - + name: Login to registry uses: docker/login-action@v3 with: - registry: gitea.client.c-one-infra.de - username: ${{ github.repository }} - password: ${{ secrets.PACKAGES_TOKEN }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + registry: ${{ steps.repository.outputs.registry }} + username: "${{ secrets.PACKAGES_USER }}" + password: "${{ secrets.PACKAGES_TOKEN }}" - name: Build and push uses: docker/build-push-action@v6 with: push: true - tags: gitea.client.c-one-infra.de/giteaadmin/app:latest \ No newline at end of file + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.docker.outputs.tags }} diff --git a/Dockerfile b/Dockerfile index 45ea65f..4280220 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ COPY ./ ./ # RUN go mod download +RUN echo jojo RUN CGO_ENABLED=0 GOOS=linux go build -o fibonacci-go cmd/main.go # ToDo: use stretch as image for a completly empty container