Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add output release manager for image tag #21

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
push:
branches:
- "master"
release:

jobs:
release-please:
Expand All @@ -15,20 +16,10 @@ jobs:
with:
release-type: "simple"
build-images:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
needs: release-please
steps:
- uses: actions/checkout@v2
- name: Set ENV for branch master/main
if: ${{ github.ref == 'refs/heads/master' }}
run: echo "RELEASE_VERSION=latest" >> $GITHUB_ENV
- name: Set ENV for tags
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set ENV for specific branch
if: ${{ startsWith(github.ref, 'refs/heads/') && !endsWith(github.ref, '/master') }}
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}-${GITHUB_SHA}" >> $GITHUB_ENV
- name: Login to GHCR
uses: docker/login-action@v1
with:
Expand All @@ -37,8 +28,9 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Image Odyssey
uses: docker/build-push-action@v2
if: ${{ steps.release_please.outputs.release_created }}
with:
context: .
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}
tags: ghcr.io/${{ github.repository }}:${{ steps.release-please.outputs.tag_name }}