Skip to content

Commit

Permalink
added docker-build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
antiyro committed Oct 22, 2024
1 parent ee933b5 commit c61ac1b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion docker/deployer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c61ac1b

Please sign in to comment.