diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index c1e4846..4eccf56 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -8,10 +8,11 @@ on: jobs: build-and-push: runs-on: docker - # actions/checkout & co. are JS actions and need Node, so the job - # container has to be a Node image (not a bare docker CLI image). The - # runner already provides a privileged container wired up to its own - # dind sidecar via DOCKER_HOST, so we just need the docker CLI itself. + # actions/checkout is a JS action and needs Node, so the job container + # has to be a Node image. The runner already provides a privileged + # container wired up to its own dind sidecar via DOCKER_HOST, so we + # just need the docker CLI itself. Plain `docker` commands (rather + # than buildx-based actions) pick up DOCKER_HOST directly. container: node:20-bookworm steps: - name: Checkout @@ -27,24 +28,17 @@ jobs: echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo $VERSION_CODENAME) stable" \ > /etc/apt/sources.list.d/docker.list apt-get update - apt-get install -y --no-install-recommends docker-ce-cli docker-buildx-plugin + apt-get install -y --no-install-recommends docker-ce-cli - name: Log in to Forgejo registry - uses: docker/login-action@v3 - with: - registry: git.rosenvold.tech - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login git.rosenvold.tech -u "${{ github.actor }}" --password-stdin - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Build image + run: | + docker build \ + -t git.rosenvold.tech/lucas/rosenvold-core:latest \ + -t git.rosenvold.tech/lucas/rosenvold-core:${{ github.sha }} \ + -f Containerfile . - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: ./Containerfile - push: true - tags: | - git.rosenvold.tech/lucas/rosenvold-core:latest - git.rosenvold.tech/lucas/rosenvold-core:${{ github.sha }} + - name: Push image + run: docker push git.rosenvold.tech/lucas/rosenvold-core --all-tags