From e4bd621480bc5d968cffff2b495cf7ca3a356766 Mon Sep 17 00:00:00 2001 From: kraysent Date: Fri, 26 Jun 2026 21:15:20 +0200 Subject: [PATCH 1/3] update template --- .github/workflows/build.yaml | 35 ------------- .github/workflows/ci.yaml | 91 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 49 ------------------ .github/workflows/tests.yaml | 24 --------- .template.yaml | 2 +- 5 files changed, 92 insertions(+), 109 deletions(-) delete mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/release.yaml delete mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index a520f02..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build image - -on: - - push - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: Install uv - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - - name: Install deps - run: make install-dev - - - name: Run codegen - run: make gen - - - name: Set up Docker runtime - uses: docker/setup-buildx-action@v3 - - - name: Build image - uses: docker/build-push-action@v6 - with: - context: . - load: true - push: false - tags: local/test-image:latest - - - name: Run image help - run: docker run --rm --entrypoint "${{ github.event.repository.name }}" local/test-image:latest --help diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..1ee64b1 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,91 @@ +name: CI + +on: + push: + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + + - name: Install deps + run: make install-dev + + - name: Run checks + run: make check + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Set up Docker runtime + uses: docker/setup-buildx-action@v3 + + - name: Build image + uses: docker/build-push-action@v6 + with: + context: . + load: true + push: false + tags: local/app:latest + + - name: Run image help + run: docker run --rm --entrypoint "uploader" local/app:latest --help + + - name: Save image + run: docker save local/app:latest -o image.tar + + - name: Upload image + uses: actions/upload-artifact@v4 + with: + name: docker-image + path: image.tar + retention-days: 1 + + release: + runs-on: ubuntu-latest + needs: [tests, build] + if: github.ref_name == github.event.repository.default_branch + permissions: + contents: read + packages: write + steps: + - name: Download image + uses: actions/download-artifact@v4 + with: + name: docker-image + + - name: Set up Docker runtime + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Load image + run: docker load -i image.tar + + - name: Set image name + run: echo "IMAGE_NAME=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV" + + - name: Set short SHA + run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_ENV" + + - name: Push image + run: | + + docker tag local/app:latest ${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }} + docker tag local/app:latest ${{ env.IMAGE_NAME }}:latest + docker push ${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }} + docker push ${{ env.IMAGE_NAME }}:latest + diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 076d80d..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Release image - -on: - workflow_dispatch: - -jobs: - release: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v6 - - - name: Install uv - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - - name: Install deps - run: make install-dev - - - name: Run codegen - run: make gen - - - name: Set up Docker runtime - uses: docker/setup-buildx-action@v3 - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Set image name - run: echo "IMAGE_NAME=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV" - - - name: Set short SHA - run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_ENV" - - - name: Build and push image - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: | - ${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }} - ${{ env.IMAGE_NAME }}:latest diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml deleted file mode 100644 index ac6270f..0000000 --- a/.github/workflows/tests.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: "[backend] Static checks & tests" - -on: - - push - -jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: Install uv - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - - name: Install deps - run: make install-dev - - - name: Run codegen - run: make gen - - - name: Run checks - run: make check diff --git a/.template.yaml b/.template.yaml index 16a406a..88ddb51 100644 --- a/.template.yaml +++ b/.template.yaml @@ -1,6 +1,6 @@ # Autogenerated - DO NOT EDIT # Parameters of the project as generated from template -_commit: dcba0b0 +_commit: 6b97e37 _src_path: gh:kraysent/python-template package_name: uploader project_name: uploader From 4a9f35287951b50c3efc3418ece1f9c39eef7f2b Mon Sep 17 00:00:00 2001 From: kraysent Date: Fri, 26 Jun 2026 21:24:47 +0200 Subject: [PATCH 2/3] add make gen to install dev command --- makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/makefile b/makefile index e892802..c61ff91 100644 --- a/makefile +++ b/makefile @@ -6,6 +6,7 @@ install-frontend: install-dev: uv sync --all-extras + $(MAKE) gen install-dev-frontend: cd frontend && yarn install From b24d5384c9e1f9ea492478f3533f991ebb6fb705 Mon Sep 17 00:00:00 2001 From: kraysent Date: Sat, 27 Jun 2026 16:12:02 +0200 Subject: [PATCH 3/3] fix ci --- .github/workflows/ci.yaml | 12 ++++++++++++ makefile | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1ee64b1..aaca8ca 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,6 +17,9 @@ jobs: - name: Install deps run: make install-dev + - name: Run codegen + run: make gen + - name: Run checks run: make check @@ -25,6 +28,15 @@ jobs: steps: - uses: actions/checkout@v6 + - name: Install uv + uses: astral-sh/setup-uv@v7 + + - name: Install deps + run: make install-dev + + - name: Run codegen + run: make gen + - name: Set up Docker runtime uses: docker/setup-buildx-action@v3 diff --git a/makefile b/makefile index c61ff91..e892802 100644 --- a/makefile +++ b/makefile @@ -6,7 +6,6 @@ install-frontend: install-dev: uv sync --all-extras - $(MAKE) gen install-dev-frontend: cd frontend && yarn install