Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .github/workflows/build.yaml

This file was deleted.

103 changes: 103 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
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 codegen
run: make gen

- name: Run checks
run: make check

build:
runs-on: ubuntu-latest
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

- 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

49 changes: 0 additions & 49 deletions .github/workflows/release.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/tests.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .template.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading