Merge pull request #371 from Interhyp/RELTEC-11165 #820
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: Go | ||
on: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
jobs: | ||
build: | ||
name: 📦 Build & Test | ||
runs-on: ubuntu-latest | ||
outputs: | ||
image: ${{ steps.meta.outputs.tags }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/setup-buildx-action@v2 | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=ref,event=branch,pattern=snapshot-{{sha}} | ||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
release: | ||
name: 🚀 Release | ||
if: github.ref == 'refs/heads/main' | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: go-semantic-release/action@v1 | ||
with: | ||
hooks: goreleaser | ||
prerelease: false | ||
allow-initial-development-versions: true # remove to trigger an initial 1.0.0 release | ||
changelog-generator-opt: "emojis=true" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- id: meta | ||
uses: docker/metadata-action@v5 | ||
images: ghcr.io/${{ github.repository }} | ||
Check failure on line 55 in .github/workflows/go.yaml GitHub Actions / GoInvalid workflow file
|
||
tags: | | ||
type=semver,pattern={{version}} | ||
- run: | | ||
TARGET=${{ steps.meta.outputs.tags }} | ||
SOURCE=${{ needs.build.outputs.image }} | ||
docker pull $SOURCE | ||
docker tag $SOURCE $TARGET | ||
docker push $TARGET |