Skip to content

Commit

Permalink
Add GitHub Action release
Browse files Browse the repository at this point in the history
Add GitHub Action to release a container image from source.
  • Loading branch information
HeavyWombat committed Dec 13, 2024
1 parent 10bbd6a commit 286e2ca
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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" \
.

0 comments on commit 286e2ca

Please sign in to comment.