Skip to content

Merge pull request #300 from SharedCode/chore/rebrand-to-joltrin #62

Merge pull request #300 from SharedCode/chore/rebrand-to-joltrin

Merge pull request #300 from SharedCode/chore/rebrand-to-joltrin #62

Workflow file for this run

# Continuous delivery pipeline:
#
# commit -> build -> tests -> package -> staging
# |______CI______| (GHCR) (smoke)
#
# This workflow always finishes as soon as staging passes. Production
# promotion (the human-approved step) lives in promote.yml, triggered
# after this workflow succeeds, so a pending approval never turns this
# pipeline's status red. See promote.yml for the [approval] -> prod leg.
name: Deliver
on:
push:
branches: [ master ]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: go vet ./inmemory/... ./btree/... ./examples/quickstart
- run: go build ./inmemory/... ./btree/... ./examples/quickstart
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: go test ./inmemory ./btree -count=1 -v 2>&1 | tail -20
package:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Set image name
run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/joltrin-quickstart" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: |
docker build -f Dockerfile.quickstart -t $IMAGE:${{ github.sha }} .
docker push $IMAGE:${{ github.sha }}
staging:
needs: package
runs-on: ubuntu-latest
environment: staging
permissions:
packages: read
steps:
- name: Set image name
run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/joltrin-quickstart" >> "$GITHUB_ENV"
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Smoke test the packaged image
run: |
docker run --rm $IMAGE:${{ github.sha }} | tee out.txt
grep -q "quickstart: OK" out.txt