From c61ac1bfd6899e9f5eaa0216e510a44480b2b889 Mon Sep 17 00:00:00 2001 From: antiyro Date: Tue, 22 Oct 2024 14:31:19 +0100 Subject: [PATCH] added docker-build workflow --- .github/workflows/docker-build.yml | 44 ++++++++++++++++++++++++++++++ docker/deployer/Dockerfile | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000000..224c2b580c --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,44 @@ +name: Build and Push Docker Image to GHCR + +on: + release: + types: [published] + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + build_and_push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set Docker image tag + id: vars + run: | + if [ "${{ github.event_name }}" == "release" ]; then + echo "TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV + else + echo "TAG=latest" >> $GITHUB_ENV + fi + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: ./docker/deployer/Dockerfile + push: true + tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ env.TAG }} diff --git a/docker/deployer/Dockerfile b/docker/deployer/Dockerfile index 63978d2ca4..c3e096b198 100644 --- a/docker/deployer/Dockerfile +++ b/docker/deployer/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* ENV VIRTUAL_ENV=/app/kakarot/.venv \ - PATH="/app/kakarot/.venv/bin:/root/.local/bin:$PATH" + PATH="/app/kakarot/.venv/bin:/root/.cargo/bin:/root/.local/bin:$PATH" RUN --mount=type=cache,target=/root/.cache \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y