Skip to content

Commit

Permalink
Add Release Workflow (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergerad authored Jan 8, 2025
1 parent 2c1e2d7 commit ffc9055
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/actions/push/action.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: Docker build and push
name: Docker Build + Push

inputs:
github-token:
required: true
image_tag:
image-tag:
required: false
type: string
dockerfile:
Expand Down Expand Up @@ -41,7 +41,7 @@ runs:
SHORT_SHA="$(git rev-parse --short HEAD)"
echo GHCR_TAG="ghcr.io/${{ github.repository }}/immutable-geth:develop-$BUILD_TIMESTAMP-git.$SHORT_SHA" >> $GITHUB_ENV
else
echo GHCR_TAG="ghcr.io/${{ github.repository }}/immutable-geth:${{ inputs.image_tag }}" >> $GITHUB_ENV
echo GHCR_TAG="ghcr.io/${{ github.repository }}/immutable-geth:${{ inputs.image-tag }}" >> $GITHUB_ENV
fi
- name: Restore Go mod (pkg)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build docker image, tag and push
name: Main

on:
push:
Expand All @@ -9,7 +9,7 @@ on:
jobs:
push:
name: Push Docker
runs-on: ubuntu-20-04-4-cores
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
release:
types: [published]

jobs:
setup:
name: Setup Envs
runs-on: ubuntu-latest
outputs:
tag-name: ${{ steps.get-tag-for-release.outputs.TAG_NAME }}
steps:
- name: Extract tag name for the release
id: get-tag-for-release
run: echo "TAG_NAME=$(echo ${GITHUB_REF} | sed 's/refs\/tags\///')" >> $GITHUB_OUTPUT
- name: Print tag being deployed
run: echo "The tag name being deployed is ${{ steps.get-tag-for-release.outputs.TAG_NAME }}."

push:
name: Push Docker
needs: [setup]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/push
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
image-tag: ${{ needs.setup.outputs.tag-name }}

0 comments on commit ffc9055

Please sign in to comment.