diff --git a/.github/workflows/build_features.yml b/.github/workflows/build_features.yml new file mode 100644 index 0000000..5634030 --- /dev/null +++ b/.github/workflows/build_features.yml @@ -0,0 +1,65 @@ +name: Test build a feature branch + +on: + workflow_dispatch: + inputs: + branch: + description: 'The branch to test build' + required: true + default: '' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + IMAGE_TAG: ${{ github.sha }} + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout Dockerfile + id: checkout + uses: actions/checkout@v3 + with: + ref: ${{ inputs.branch }} + + - name: Setup QEMU + id: qemu + uses: docker/setup-qemu-action@v1 + with: + image: tonistiigi/binfmt:latest + platforms: all + + - name: Setup Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=${{ startsWith(github.ref, 'refs/heads/main') }} + suffix=-${{ github.sha }} + + - name: Build Docker image + id: build + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64/v8 + push: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Upload image + uses: ishworkh/docker-image-artifact-upload@v1 + with: + image: ${{ steps.meta.outputs.tags }} + retention_days: "1" \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5471ab..9115554 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,10 +1,8 @@ -name: Main build +name: Build and Publish Docker Image on: push: branches: [ main ] - pull_request: - branches: [ main ] schedule: - cron: '24 9 * * 6' workflow_dispatch: diff --git a/hypercorn.toml b/hypercorn.toml new file mode 100644 index 0000000..2569fb0 --- /dev/null +++ b/hypercorn.toml @@ -0,0 +1 @@ +bind \ No newline at end of file