workflow: run goreleaser on tag push

Ayman Bagabas created

push images to docker.io and ghcr.io
update docker.io readme

Change summary

.github/workflows/goreleaser.yml | 54 ++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

Detailed changes

.github/workflows/goreleaser.yml 🔗

@@ -0,0 +1,54 @@
+name: goreleaser
+
+on:
+  push:
+    tags:
+      - '*'
+
+permissions:
+  contents: write
+
+jobs:
+  goreleaser:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+
+      - name: Set up Go
+        uses: actions/setup-go@v2
+        with:
+          go-version: 1.17
+
+      - name: Login to DockerHub
+        uses: docker/login-action@v1
+        with:
+          registry: docker.io/charmcli
+          username: ${{ secrets.DOCKERHUB_USERNAME }}
+          password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+      - name: Login to GitHub Container Registry
+        uses: docker/login-action@v1
+        with:
+          registry: ghcr.io
+          username: ${{ github.repository_owner }}
+          password: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Run GoReleaser
+        uses: goreleaser/goreleaser-action@v2
+        with:
+          distribution: goreleaser
+          version: latest
+          args: release --rm-dist
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Update Docker Hub Readme
+        uses: christian-korneck/update-container-description-action@v1
+        with:
+          destination_container_repo: charmcli/soft-serve
+          provider: dockerhub
+          short_description: "A tasty Git server 🍦"
+          readme_file: "README.md"