From 9f5258fe2256f3822c9ebad49d8fb1d8e4ec62b8 Mon Sep 17 00:00:00 2001 From: shoebill <146384420+balaenicipitidae@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:26:09 -0400 Subject: [PATCH] Draft Github CI Pipeline (#17) This commit defines a basic CI pipeline for releasing Pull-Pal to prospective users. The artifacts include Pull-Pal's source and container. --- .github/workflows/build-tag-release.yml | 57 +++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/build-tag-release.yml diff --git a/.github/workflows/build-tag-release.yml b/.github/workflows/build-tag-release.yml new file mode 100644 index 0000000..6c8ef38 --- /dev/null +++ b/.github/workflows/build-tag-release.yml @@ -0,0 +1,57 @@ +name: Build, Tag, and Release + +on: + workflow_dispatch + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Grep the Short SHA + uses: benjlevesque/short-sha@v2.2 + id: short-sha + with: + length: 6 + + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Lint Dockerfile + uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: Dockerfile + failure-threshold: error + + - name: Build Docker Image + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfile + tags: "pullpal:${{ steps.short-sha.outputs.sha }}" + push: false + load: true + + - name: Smoke Test Container + run: docker run -d --name pullpal pullpal:${{ steps.short-sha.outputs.sha }} + + - name: Dump and Deflate Container + run: | + docker save pullpal:${{ steps.short-sha.outputs.sha }} \ + | gzip -9kv > pullpalcontainer-${{ steps.short-sha.outputs.sha }}.tar.gz + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: "pullpal-${{ steps.short-sha.outputs.sha }}" + body: "A digital assistant that writes code and collaborates with humans on git repositories!" + files: pullpalcontainer-${{ steps.short-sha.outputs.sha }}.tar.gz