From a827db87ee9758558f10bb594414fcef07954ef1 Mon Sep 17 00:00:00 2001 From: Azamat <86872713+AzamatKomaev@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:32:29 +0300 Subject: [PATCH] add .github/workflows, add build.yaml workflow (#2) * add docker support, create prod.py * fix first message after running prod.py * fix container name, add volumes for auto-reload * add .github/workflows, add build.yaml workflow --- .github/workflows/build.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..a582a2f --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,32 @@ +name: build +on: + push: + branches: + - "*" + paths-ignore: + - "README.md" + workflow_dispatch: + +env: + REGISTRY_URL: ghcr.io + REGISTRY_USERNAME: azamatkomaev + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + IMAGE_TAG: ${{ github.sha }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Login with Github Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY_URL }} + username: ${{ env.REGISTRY_USERNAME }} + password: ${{ env.REGISTRY_PASSWORD }} + - name: Build & Publish to Github Container registry + run: | + docker build ./backend --tag $REGISTRY_URL/$REGISTRY_USERNAME/calendarit-backend:latest \ + --tag $REGISTRY_URL/$REGISTRY_USERNAME/calendarit-backend:$IMAGE_TAG + docker push $REGISTRY_URL/$REGISTRY_USERNAME/calendarit-backend:latest + docker push $REGISTRY_URL/$REGISTRY_USERNAME/calendarit-backend:$IMAGE_TAG \ No newline at end of file