From dd262b84246bab2e76da657666b9a16d15e653e7 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 13 Mar 2023 17:53:24 -0700 Subject: [PATCH] ci: adjust docker build to also publish --- .github/workflows/continuous-docker.yml | 31 ++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-docker.yml b/.github/workflows/continuous-docker.yml index 9b8f5498..a3d78d22 100644 --- a/.github/workflows/continuous-docker.yml +++ b/.github/workflows/continuous-docker.yml @@ -16,13 +16,38 @@ on: workflow_dispatch: env: - CARGO_TERM_COLOR: always + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: docker-build: runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: - uses: actions/checkout@v3 - - name: Build Image - run: ./docker/kumod/build-docker-image.sh + + - name: Log in to the Container registry + uses: docker/login-action@v2.1.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4.3.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4.0.0 + with: + context: . + push: true + file: docker/kumod/Dockerfile + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}