mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 20:47:10 +11:00
Docker
[WIP] ci: add Dockerfile and deploy workflow
This commit is contained in:
commit
32b212b83b
4 changed files with 50 additions and 1 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
/build
|
||||||
|
/config.json
|
||||||
31
.github/workflows/deploy.yaml
vendored
Normal file
31
.github/workflows/deploy.yaml
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
name: Publish Staging
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- cicd
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Push Docker image to GitHub Packages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Login to GitHub Docker Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: docker.pkg.github.com
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Format repository
|
||||||
|
run: |
|
||||||
|
echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
|
||||||
|
- name: Build container image
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
docker.pkg.github.com/${{ env.IMAGE_REPOSITORY }}/ccash:${{ github.sha }}
|
||||||
|
docker.pkg.github.com/${{ env.IMAGE_REPOSITORY }}/ccash:latest
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
.vscode
|
.vscode
|
||||||
build
|
build
|
||||||
config.json
|
config.json
|
||||||
users.json
|
users.json
|
||||||
|
|
|
||||||
16
Dockerfile
Normal file
16
Dockerfile
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
FROM debian:latest
|
||||||
|
|
||||||
|
WORKDIR /ccash
|
||||||
|
|
||||||
|
RUN apt update && apt -y install build-essential g++ cmake protobuf-compiler libjsoncpp-dev uuid-dev openssl libssl-dev zlib1g-dev
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN mkdir build
|
||||||
|
|
||||||
|
WORKDIR /ccash/build
|
||||||
|
|
||||||
|
RUN cmake ..
|
||||||
|
RUN make -j$(nprov)
|
||||||
|
|
||||||
|
CMD ["/ccash/build/bank", "$CCASH_ADMIN_PASSWORD", "$CCASH_SAVE_FREQUENCY", "$CCASH_THREAD_COUNT"]
|
||||||
Loading…
Reference in a new issue