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