diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7a6d892 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +--- +name: Release Registry Image Resource + +on: + push: + branches: + - main + +jobs: + release: + if: ${{ github.repository == 'homeport/registry-image-resource' }} + runs-on: ubuntu-latest + permissions: + packages: write + + env: + IMAGE_HOST: ghcr.io + IMAGE_NAME: ${{ github.repository }} + + steps: + - uses: actions/checkout@v4 + - name: Build and push container image + env: + REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + REGISTRY_USERNAME: ${{ github.repository_owner }} + run: | + docker login \ + --username "$REGISTRY_USERNAME" \ + --password-stdin \ + "$IMAGE_HOST" <<<"$REGISTRY_PASSWORD" + + docker build \ + --push \ + --build-arg base_image=paketobuildpacks/run-jammy-base:latest \ + --tag "${IMAGE_HOST}/${IMAGE_NAME}:latest" \ + .