-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "Dockerfile.storybook" | ||
pull_request: | ||
paths: | ||
- "Dockerfile.storybook" | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }}/storybook-env | ||
|
||
jobs: | ||
storybook-build-and-push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=sha,format=long | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: Dockerfile.storybook | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM mcr.microsoft.com/playwright:v1.49.1 | ||
|
||
# Set environment variables | ||
ENV CI=true \ | ||
TZ=UTC \ | ||
DISPLAY=:99 | ||
|
||
# Install additional dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
curl \ | ||
build-essential \ | ||
jq \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Rust and wasm-pack | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ | ||
. $HOME/.cargo/env && \ | ||
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | ||
|
||
# Add cargo to PATH | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Install pnpm | ||
RUN corepack enable pnpm | ||
|
||
# Setup display with consistent resolution | ||
RUN Xvfb :99 -screen 0 1280x1024x24 2>/dev/null & | ||
|
||
WORKDIR /app | ||
|
||
# Default command that can be overridden | ||
CMD ["bash"] |