Skip to content

Commit

Permalink
added release.yaml (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb authored Dec 23, 2024
1 parent 493b95d commit 233b35b
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Docker Release

on:
push:
tags:
- '*'

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: petabridge/pbm

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
petabridge/pbm:latest
petabridge/pbm:${{ github.ref_name }}
labels: ${{ steps.meta.outputs.labels }}

- name: Create and push manifest
run: |
docker manifest create petabridge/pbm:latest \
petabridge/pbm:latest-linux-amd64 \
petabridge/pbm:latest-linux-arm64
docker manifest annotate petabridge/pbm:latest petabridge/pbm:latest-linux-arm64 --arch arm64
docker manifest push petabridge/pbm:latest
- name: Update DockerHub README
uses: docker/metadata-action@v4
with:
images: petabridge/pbm
flavor: latest=false
labels: |
org.opencontainers.image.description=${{ github.event.repository.description }}
readme-filepath: ./README.md

- name: Generate release notes
id: release_notes
run: |
echo "### Release Notes" > release_notes.md
git log --oneline $(git describe --tags --abbrev=0 @^)..@ >> release_notes.md
- name: Create GitHub release
run: |
gh release create ${{ github.ref_name }} release_notes.md --title "Release ${{ github.ref_name }}" --notes-file release_notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 233b35b

Please sign in to comment.