squash v4 #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: π Release | |
on: | |
push: | |
tags: ["*"] | |
permissions: | |
contents: write | |
packages: write | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: sedaprotocol/seda-data-proxy | |
jobs: | |
build-and-push: | |
name: π³ Build and Push Docker Image | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target_arch: | |
- bun-linux-x64-modern | |
- bun-linux-arm64 | |
include: | |
- target_arch: bun-linux-x64-modern | |
platform: linux/amd64 | |
- target_arch: bun-linux-arm64 | |
platform: linux/arm64 | |
steps: | |
- name: π₯ Checkout code | |
uses: actions/checkout@v4 | |
- name: π·οΈ Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=edge,branch=main | |
- name: π οΈ Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: π Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: ποΈ Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: .build/docker/Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
TARGET_ARCH=${{ matrix.target_arch }} | |
platforms: ${{ matrix.platform }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: β¨ Save image details | |
run: echo "${{ steps.meta.outputs.tags }}" > image-details.txt | |
- name: π¦ Upload image details as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: image-details | |
path: image-details.txt | |
create-release: | |
name: π¦ Create GitHub Release | |
needs: build-and-push | |
runs-on: ubuntu-latest | |
steps: | |
- name: π₯ Checkout code | |
uses: actions/checkout@v4 | |
- name: π Generate Changelog | |
id: changelog | |
uses: TriPSs/conventional-changelog-action@v5.3.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
output-file: false | |
skip-commit: true | |
skip-tag: true | |
skip-git-pull: true | |
git-push: false | |
- name: π½ Download image details artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: image-details | |
path: ./image-details.txt | |
- name: π Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
generateReleaseNotes: true | |
body: | | |
${{ steps.changelog.outputs.changelog }} | |
## Docker Images | |
The following Docker images were built and published: | |
``` | |
${{ steps.changelog.outputs.changelog }} | |
${{ steps.release.outputs.uploaded }} | |
``` | |
token: ${{ secrets.GITHUB_TOKEN }} |