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.
This commit is contained in:
shoebill 2023-10-20 15:26:09 -04:00 committed by GitHub
parent b0e45216bc
commit 9f5258fe22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 57 additions and 0 deletions

57
.github/workflows/build-tag-release.yml vendored Normal file
View File

@ -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