diff --git a/.github/workflows/docker-sha.yml b/.github/workflows/docker-sha.yml new file mode 100644 index 00000000..7552bff8 --- /dev/null +++ b/.github/workflows/docker-sha.yml @@ -0,0 +1,33 @@ +# Always push sha image, only push for branch if all other jobs successful +on: + push: + branches: + - main + pull_request: + branches: + - '*' + +name: Docker build and push SHA +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Login to GHCR (GitHub Packages) + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ env.GITHUB_PAT }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build + run: ./docker/build + + - name: Push + run: ./docker/push diff --git a/docker/push b/docker/push new file mode 100644 index 00000000..e3d0668a --- /dev/null +++ b/docker/push @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -e +HERE=$(dirname $0) +. $HERE/common + +docker push "$APP_TAG_SHA" \ No newline at end of file