Skip to content

Commit

Permalink
fix build and push
Browse files Browse the repository at this point in the history
  • Loading branch information
jonerrr committed Dec 13, 2024
1 parent cb2204e commit cf11988
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
name: Build and push Docker image

# Turns out on release does not actually run on release. thanks microsoft
# See https://github.com/orgs/community/discussions/25281
# on:
# release:
# types: [published]
on:
release:
types: [published]
workflow_run:
workflows: ['Bump Version and Create Release']
types:
- completed

jobs:
build-and-push:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/[email protected]

- name: Get Release Tag
id: get_tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG=$(gh release view --json tagName -q .tagName)
echo "TAG=$TAG" >> "$GITHUB_ENV"
# TAG=$(gh release view "${{ github.event.workflow_run.head_commit.id }}" --json tagName -q .tagName)
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
Expand All @@ -25,4 +42,6 @@ jobs:
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/bus-map:latest
ghcr.io/${{ github.repository_owner }}/bus-map:${{ github.event.release.tag_name }}
ghcr.io/${{ github.repository_owner }}/bus-map:${{ env.TAG }}
# ghcr.io/${{ github.repository_owner }}/bus-map:${{ github.event.release.tag_name }}

0 comments on commit cf11988

Please sign in to comment.