Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dockerfile and workflow to push to dockerhub #244

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,36 @@ jobs:
name: artifacts
path: dist-manifest.json

publish-to-dockerhub:
runs-on: ubuntu-latest
needs: [plan, host]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Build and push docker image"
run: |
docker build . -t leptos/cargo-leptos:latest -t leptos/cargo-leptos:stable;
docker push leptos/cargo-leptos:latest;
docker push leptos/cargo-leptos:stable;

tag="";
for i in $(echo ${{ needs.plan.outputs.tag }} | tr '.' '\n')
do
if [[ $tag == "" ]]; then
tag="$i";
else
tag="$tag.$i";
fi
docker tag leptos/cargo-leptos:latest leptos/cargo-leptos:$tag;
docker push leptos/cargo-leptos:$tag;
done

# Create a Github Release while uploading all files to it
announce:
needs:
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM --platform=amd64 rust:1.71 as build

RUN cargo install cargo-leptos

FROM --platform=amd64 rust:1.71

COPY --from=build /usr/local/cargo/bin/cargo-leptos /usr/local/cargo/bin/cargo-leptos

ENTRYPOINT ["cargo-leptos"]
Loading