mirror of
https://codeberg.org/icewind/shelve.git
synced 2026-06-03 12:04:09 +02:00
ci
This commit is contained in:
parent
f6b09d03ef
commit
e7c6b72d27
3 changed files with 78 additions and 9 deletions
42
.github/workflows/ci.yaml
vendored
Normal file
42
.github/workflows/ci.yaml
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
name: Continuous integration
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
name: Check
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
- uses: Swatinem/rust-cache@v1
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: check
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build Binaries
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: musl-tools
|
||||||
|
run: |
|
||||||
|
sudo apt-get install musl-tools
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
target: x86_64-unknown-linux-musl
|
||||||
|
- uses: Swatinem/rust-cache@v1
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --release --target x86_64-unknown-linux-musl
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: shelve
|
||||||
|
path: target/x86_64-unknown-linux-musl/release/shelve
|
||||||
27
.github/workflows/docker.yaml
vendored
Normal file
27
.github/workflows/docker.yaml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
name: docker-build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- 'master'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: Build and push
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: icewind1991/shelve:latest
|
||||||
|
- name: Image digest
|
||||||
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
18
Dockerfile
18
Dockerfile
|
|
@ -1,13 +1,13 @@
|
||||||
#FROM ekidd/rust-musl-builder AS build
|
FROM ekidd/rust-musl-builder AS build
|
||||||
#
|
|
||||||
#ADD . ./
|
ADD . ./
|
||||||
#RUN sudo chown -R rust:rust .
|
RUN sudo chown -R rust:rust .
|
||||||
#
|
|
||||||
#RUN cargo build --release
|
RUN cargo build --release
|
||||||
#
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
#
|
|
||||||
#COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/shelve /
|
COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/shelve /
|
||||||
RUN mkdir /data
|
RUN mkdir /data
|
||||||
ADD ./target/x86_64-unknown-linux-musl/release/shelve /
|
ADD ./target/x86_64-unknown-linux-musl/release/shelve /
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue