feat: github action build for DockerHub
This commit is contained in:
@@ -7,16 +7,8 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
# cache some rust data?
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
target
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
# Build for linux x86_64
|
# Build for linux x86_64
|
||||||
- name: build release linux_x86_64
|
- name: build release linux_x86_64
|
||||||
@@ -72,6 +64,25 @@ jobs:
|
|||||||
- name: compress windows_x86_64 binary
|
- name: compress windows_x86_64 binary
|
||||||
run: zip -j ./oxker_windows_x86_64.zip target/x86_64-pc-windows-gnu/release/oxker.exe
|
run: zip -j ./oxker_windows_x86_64.zip target/x86_64-pc-windows-gnu/release/oxker.exe
|
||||||
|
|
||||||
|
# Build images for Dockerhub
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- uses: docker/setup-buildx-action@v2
|
||||||
|
id: buildx
|
||||||
|
with:
|
||||||
|
install: true
|
||||||
|
- name: Build for Docker Hub
|
||||||
|
run: |
|
||||||
|
docker build --platform linux/arm/v6,linux/arm64,linux/amd64 \
|
||||||
|
-t ${{ secrets.DOCKERHUB_USERNAME }}/oxker:latest \
|
||||||
|
--push \
|
||||||
|
-f containerised/Dockerfile .
|
||||||
|
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ WORKDIR /usr/src
|
|||||||
RUN cargo new oxker
|
RUN cargo new oxker
|
||||||
|
|
||||||
# We want dependencies cached, so copy those first
|
# We want dependencies cached, so copy those first
|
||||||
COPY Cargo.toml Cargo.lock /usr/src/oxker/
|
COPY Cargo.* /usr/src/oxker/
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /usr/src/oxker
|
WORKDIR /usr/src/oxker
|
||||||
@@ -55,4 +55,4 @@ COPY --from=builder /oxker /usr/local/bin
|
|||||||
COPY ./containerised/start_oxker.sh ./
|
COPY ./containerised/start_oxker.sh ./
|
||||||
|
|
||||||
# Run the application
|
# Run the application
|
||||||
ENTRYPOINT [ "./start_oxker.sh"]
|
ENTRYPOINT [ "./start_oxker.sh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user