From bb028f63bca4ec4f8ea9abc87b8a336b5f22fd0b Mon Sep 17 00:00:00 2001 From: Luca Favini Date: Sun, 21 Apr 2024 13:15:37 +0200 Subject: [PATCH] ci: fix and rename `build-backend` action --- .github/workflows/build-backend.yml | 22 ++++++++++++++++++++++ .github/workflows/deploy-backend.yml | 19 ------------------- README.md | 2 +- 3 files changed, 23 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/build-backend.yml delete mode 100644 .github/workflows/deploy-backend.yml diff --git a/.github/workflows/build-backend.yml b/.github/workflows/build-backend.yml new file mode 100644 index 0000000..9b3f614 --- /dev/null +++ b/.github/workflows/build-backend.yml @@ -0,0 +1,22 @@ +name: build-backend + +on: + push: + branches: [ "main" ] + +jobs: + build-backend: + name: Build backend + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Build & push Docker image + uses: mr-smithers-excellent/docker-build-push@v6 + with: + image: cess-advisor-backend + tags: latest + registry: ghcr.io + dockerfile: Dockerfile + username: ${{ secrets.GHCR_USERNAME }} + password: ${{ secrets.GHCR_TOKEN }} diff --git a/.github/workflows/deploy-backend.yml b/.github/workflows/deploy-backend.yml deleted file mode 100644 index 5ea6656..0000000 --- a/.github/workflows/deploy-backend.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: deploy-backend - -on: - push: - branches: [ "main" ] - -steps: - - uses: actions/checkout@v3 - name: Check out code - - - uses: mr-smithers-excellent/docker-build-push@v6 - name: Build & push Docker image - with: - image: cess-advisor-backend - tags: latest - registry: ghcr.io - dockerfile: Dockerfile - username: ${{ secrets.GHCR_USERNAME }} - password: ${{ secrets.GHCR_TOKEN }} diff --git a/README.md b/README.md index 0a18128..9149ec6 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ TL;DR: **Docker** 🐳 + **GitHub Actions** 🤖 for backend and **Cloudflare Pa Detailed deployment - Backend: **Docker** 🐳 + **GitHub Actions** 🤖 - - each time a commit is pushed to the `main` branch, `deploy` GitHub action is triggered + - each time a commit is pushed to the `main` branch, `build-backend` GitHub action is triggered - the action builds the Docker image and pushes it to the GitHub container registry - the image is then pulled by my homelab server (periodically checked with Watchtower) and the container is started - the backend is available at [https://cessadvisorapi.favo02.dev](https://cessadvisorapi.favo02.dev)