Skip to content

Commit

Permalink
Added dockerfile and workflow to push to dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
rakshith-ravi committed Jan 24, 2024
1 parent 0a14df0 commit a167779
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
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, should-publish]
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"]

0 comments on commit a167779

Please sign in to comment.