From 62b64e47b84c9cf049bc659554a94066f617bc65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=A0indel=C3=A1=C5=99?= Date: Tue, 17 Oct 2023 10:54:34 +0200 Subject: [PATCH] Build and push docker image via Github Actions --- .github/workflows/docker-image.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..0215645 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,25 @@ +name: Build and push + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Docker Login + # You may pin to the exact commit or the version. + # uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d + uses: docker/login-action@v3.0.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push the Docker image + run: EPOCH=$(date +%s) && docker build . --file Dockerfile --tag houbystudio/small-business-fridge:$EPOCH && docker push houbystudio/small-business-fridge:$EPOCH