Added docker push script and build cicd
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>pull/7/head
parent
71798be854
commit
c73335c170
|
@ -0,0 +1,18 @@
|
||||||
|
name: Build Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev
|
||||||
|
- cicd
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: [ubuntu-latest, aya01]
|
||||||
|
steps:
|
||||||
|
- uses: docker/setup-buildx-action@v3
|
||||||
|
- uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
tags: tudattr/athome:latest
|
18
Dockerfile
18
Dockerfile
|
@ -1,17 +1,19 @@
|
||||||
FROM rust:1.77.2 as builder
|
FROM rust:1.77.2 as dioxus
|
||||||
WORKDIR /athome/
|
|
||||||
RUN cargo install dioxus-cli@^0.5
|
RUN cargo install dioxus-cli@^0.5
|
||||||
RUN apt update && apt install nodejs npm -y && rm -rf /var/lib/apt/lists/*
|
|
||||||
RUN npm install -D tailwindcss
|
|
||||||
|
|
||||||
FROM builder
|
FROM dioxus as builder
|
||||||
WORKDIR /athome/
|
WORKDIR /athome/
|
||||||
|
RUN apt-get update && apt-get install nodejs npm -y && rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN npm install -D tailwindcss
|
||||||
COPY ./src/ ./src/
|
COPY ./src/ ./src/
|
||||||
COPY ./assets/ ./assets/
|
COPY ./assets/ ./assets/
|
||||||
COPY ./Cargo.toml ./Cargo.toml
|
COPY ./Cargo.toml ./Cargo.toml
|
||||||
COPY ./input.css ./input.css
|
COPY ./input.css ./input.css
|
||||||
COPY ./Dioxus.toml ./Dioxus.toml
|
COPY ./Dioxus.toml ./Dioxus.toml
|
||||||
COPY ./tailwind.config.js ./tailwind.config.js
|
COPY ./tailwind.config.js ./tailwind.config.js
|
||||||
RUN npx tailwindcss -i ./input.css -o ./assets/tailwind.css
|
RUN npx tailwindcss -i ./input.css -o ./assets/tailwind.css && dx build --platform fullstack --release
|
||||||
RUN dx build --platform fullstack --release
|
|
||||||
ENTRYPOINT [ "./docs/athome" ]
|
FROM dioxus as runner
|
||||||
|
WORKDIR /app/
|
||||||
|
COPY --from=builder /athome/docs/ ./docs/
|
||||||
|
CMD [ "./docs/athome" ]
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
VERSION=0.1.0
|
||||||
|
LOCAL_IMAGE="athome"
|
||||||
|
REMOTE_IMAGE="athome"
|
||||||
|
|
||||||
|
docker build -t $LOCAL_IMAGE .
|
||||||
|
docker tag $LOCAL_IMAGE:latest mos4/$REMOTE_IMAGE:$VERSION
|
||||||
|
docker push mos4/$REMOTE_IMAGE:$VERSION
|
Loading…
Reference in New Issue