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