Skip to content

Commit

Permalink
ci: add release & publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dwisiswant0 committed Aug 2, 2023
1 parent 6006868 commit c7e3031
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release & Publish

on:
push:
tags: ["v*.*.**"]
workflow_dispatch:
inputs:
tag:
description: "Target tag to release & publish"
required: true
type: string

jobs:
release:
name: goreleaser-cross
runs-on: ubuntu-latest
container:
image: ghcr.io/goreleaser/goreleaser-cross:latest
steps:
- uses: actions/checkout@master
with:
ref: "${{ inputs.tag }}"

- run: goreleaser release
working-directory: "${{ github.workspace }}"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

publish:
name: publish images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: "${{ inputs.tag }}"

- uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/[email protected]
with:
push: true
build-args: "VERSION=${{ inputs.tag }}"
tags: "${{ github.repository }}:latest,${{ github.repository }}:${{ inputs.tag }}"

0 comments on commit c7e3031

Please sign in to comment.