add container step
Build and push Docker image / build-and-publish (push) Successful in 2m42s
Details
Build and push Docker image / build-and-publish (push) Successful in 2m42s
Details
This commit is contained in:
parent
9e19eae323
commit
7625df58ca
|
@ -0,0 +1,3 @@
|
|||
/target
|
||||
.forgejo
|
||||
README.md
|
|
@ -0,0 +1,32 @@
|
|||
name: Build and push Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build latest
|
||||
uses: https://codeberg.org/umglurf/kaniko-action@main
|
||||
with:
|
||||
cache: true
|
||||
cache_repo: ${{ vars.REGISTRY_URL }}/${{ github.repository }}/cache
|
||||
credentials: |
|
||||
${{ vars.REGISTRY_URL }}=${{ secrets.REGISTRY_USERNAME }}:${{ secrets.REGISTRY_TOKEN }}
|
||||
destinations: |
|
||||
${{ vars.REGISTRY_URL }}/${{ github.repository }}:latest
|
||||
push: 'true'
|
||||
if: github.ref == 'refs/heads/master'
|
||||
- name: Build ref
|
||||
uses: https://codeberg.org/umglurf/kaniko-action@main
|
||||
with:
|
||||
cache: true
|
||||
cache_repo: ${{ vars.REGISTRY_URL }}/${{ github.repository }}/cache
|
||||
credentials: |
|
||||
${{ vars.REGISTRY_URL }}=${{ secrets.REGISTRY_USERNAME }}:${{ secrets.REGISTRY_TOKEN }}
|
||||
destinations: |
|
||||
${{ vars.REGISTRY_URL }}/${{ github.repository }}:${{ github.ref_name }}
|
||||
push: 'true'
|
||||
if: github.ref != 'refs/heads/master'
|
|
@ -0,0 +1,9 @@
|
|||
FROM rustlang/rust:nightly-alpine AS build
|
||||
WORKDIR /usr/src/serverman
|
||||
COPY . .
|
||||
RUN apk add --no-cache musl-dev && \
|
||||
cargo install --path .
|
||||
|
||||
FROM rustlang/rust:nightly-alpine
|
||||
COPY --from=build /usr/local/cargo/bin/serverman /usr/local/bin/serverman
|
||||
ENTRYPOINT [ "serverman" ]
|
Loading…
Reference in New Issue