Skip to content

Commit

Permalink
ci: release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
meienberger committed Feb 22, 2024
1 parent 993fcfc commit 5386262
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release Images

on:
workflow_dispatch:
inputs:
version:
description: "Version"
required: true

jobs:
create-tag:
runs-on: ubuntu-latest
outputs:
tagname: ${{ inputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: rickstaa/action-create-tag@v1
id: create-tag
with:
tag: ${{ inputs.version }}

build-image:
runs-on: ubuntu-latest
needs: create-tag
steps:
- name: Checkout code
uses: actions/checkout@v4

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

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push images
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository_owner }}/nextgba:${{ needs.create-tag.outputs.tagname }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/nextgba:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/nextgba:buildcache,mode=max

publish-release:
runs-on: ubuntu-latest
needs: [create-tag, build-image]
outputs:
id: ${{ steps.create_release.outputs.id }}
steps:
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: |
**${{ needs.create-tag.outputs.tagname }}**
tag_name: ${{ needs.create-tag.outputs.tagname }}
name: ${{ needs.create-tag.outputs.tagname }}
draft: false
prerelease: true

0 comments on commit 5386262

Please sign in to comment.