From 7152054edbb7bc4afad335c56723e4876e736d17 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Wed, 16 Jun 2021 01:40:30 +0100 Subject: [PATCH] ci: CMD env vars, publish to GH packages --- .dockerignore | 1 + .github/workflows/deploy.yaml | 25 +++++++++++++++++++++++-- Dockerfile | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 796b96d..c733f93 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ /build +/config.json diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0c2e09f..f0362e0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -2,9 +2,30 @@ name: Publish Staging on: push: branches: - - main + - cicd jobs: release: + name: Push Docker image to GitHub Packages runs-on: ubuntu-latest + permissions: + packages: write + contents: read steps: - - uses: actions/checkout@v2 + - 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 diff --git a/Dockerfile b/Dockerfile index d7215c5..c14cd74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,4 @@ WORKDIR /ccash/build RUN cmake .. RUN make -j$(nprov) -CMD ["/ccash/build/bank", "AdminPassword", "10", "4"] +CMD ["/ccash/build/bank", "$CCASH_ADMIN_PASSWORD", "$CCASH_SAVE_FREQUENCY", "$CCASH_THREAD_COUNT"]