Merge pull request #53 from pchaseh/feat/dry-run-mode #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
- push | |
- workflow_dispatch | |
jobs: | |
goversion: | |
uses: ./.github/workflows/go-version.yaml | |
publish-tagged: | |
if: | | |
startsWith(github.ref, 'refs/tags/v') && | |
!github.event.pull_request.head.repo.fork | |
runs-on: ubuntu-latest | |
needs: goversion | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ needs.goversion.outputs.goversion }} | |
- uses: ko-build/setup-ko@v0.7 | |
name: Setup ko | |
- name: Run ko publish for ghcr.io | |
env: | |
KO_DOCKER_REPO: ghcr.io/${{ github.repository_owner }} | |
run: | | |
export COMMIT=${{ github.sha}} | |
export TAG=$(echo ${{ github.ref }} | cut -d "/" -f 3 - ) | |
ko publish ./ --base-import-paths --platform=linux/amd64,linux/arm64 --tags $TAG | |
ko publish ./ --base-import-paths --platform=linux/amd64,linux/arm64 |