From 68cedbfca3dc9d6e9ed6bf498937e3462c1e0538 Mon Sep 17 00:00:00 2001 From: Paolo Viotti Date: Sun, 10 Mar 2024 15:58:13 +0000 Subject: [PATCH] feat: add Github Action to build Docker container --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..03dfd04 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Docker login + uses: docker/login-action@v2.2.0 + if: github.event_name != 'pull_request' + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push pviotti/stockrcmdr Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: pviotti/pocket-counter:latest