From 5d41a7bc85f2c72ff6739f029e6a37a79a1fbce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Sun, 11 Feb 2024 15:35:31 +0100 Subject: [PATCH] workflow --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ Makefile | 7 ++++++- 2 files changed, 31 insertions(+), 1 deletion(-) 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..0b990dc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: build and push + +on: + workflow_dispatch: + + push: + +jobs: + build: + runs-on: ubuntu-latest + permissions: write-all + + steps: + - name: check out + uses: actions/checkout@v4 + + - name: login to docker hub + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: build and push + run: make prod diff --git a/Makefile b/Makefile index c043a80..10f2026 100644 --- a/Makefile +++ b/Makefile @@ -7,5 +7,10 @@ run: build: cargo build --release -docker: +docker_build: docker build . -t autodok + +docker_push: + docker push ghcr.io/cars10/autodok:latest + +prod: docker_build docker_push