Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
lnxpy committed Nov 19, 2024
1 parent 6b24f16 commit 68c72a4
Show file tree
Hide file tree
Showing 4 changed files with 440 additions and 9 deletions.
5 changes: 1 addition & 4 deletions pyaction/action_template/{{action_slug}}/Dockerfile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ FROM python:{{ python_version }}-slim
# Copy only the necessary binaries from uv
COPY --from=ghcr.io/astral-sh/uv:0.5.1 /uv /uvx /bin/

# Set environment variable early to take advantage of layer caching
ENV UV_PROJECT_ENVIRONMENT="/usr/local/"

# Set the working directory to /action
WORKDIR /action

Expand All @@ -17,7 +14,7 @@ COPY . .
RUN [ -f pre-script.sh ] && sh pre-script.sh || true

# Install action dependencies
RUN uv sync
RUN uv sync --no-install-project --no-cache

# running the post-script.sh
RUN [ -f post-script.sh ] && sh post-script.sh || true
Expand Down
2 changes: 1 addition & 1 deletion pyaction/action_template/{{action_slug}}/README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Example usage..
If you want to run this action locally, follow these steps.

* Clone the repo and `cd` into it.
* Run `uv sync --extra cli`.
* Run `uv sync --no-install-project --extra cli`.
* Create the `.env` file filled with the required input parameters.
* Run `uv run pyaction run`.

Expand Down
5 changes: 1 addition & 4 deletions test_action/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ FROM python:3.12-slim
# Copy only the necessary binaries from uv
COPY --from=ghcr.io/astral-sh/uv:0.5.1 /uv /uvx /bin/

# Set environment variable early to take advantage of layer caching
ENV UV_PROJECT_ENVIRONMENT="/usr/local/"

# Set the working directory to /action
WORKDIR /action

Expand All @@ -17,7 +14,7 @@ COPY . .
RUN [ -f pre-script.sh ] && sh pre-script.sh || true

# Install project dependencies first for better caching
RUN uv sync
RUN uv sync --no-install-project --no-cache

# Running the post-script.sh
RUN [ -f post-script.sh ] && sh post-script.sh || true
Expand Down
Loading

0 comments on commit 68c72a4

Please sign in to comment.