1name: goreleaser
 2
 3on:
 4  push:
 5    tags:
 6      - '*'
 7
 8permissions:
 9  contents: write
10
11jobs:
12  goreleaser:
13    runs-on: ubuntu-latest
14    steps:
15      - name: Checkout
16        uses: actions/checkout@v2
17        with:
18          fetch-depth: 0
19
20      - name: Set up Go
21        uses: actions/setup-go@v2
22        with:
23          go-version: 1.17
24
25      - name: Login to DockerHub
26        uses: docker/login-action@v1
27        with:
28          registry: docker.io/charmcli
29          username: ${{ secrets.DOCKERHUB_USERNAME }}
30          password: ${{ secrets.DOCKERHUB_TOKEN }}
31
32      - name: Login to GitHub Container Registry
33        uses: docker/login-action@v1
34        with:
35          registry: ghcr.io
36          username: ${{ github.repository_owner }}
37          password: ${{ secrets.GITHUB_TOKEN }}
38
39      - name: Run GoReleaser
40        uses: goreleaser/goreleaser-action@v2
41        with:
42          distribution: goreleaser
43          version: latest
44          args: release --rm-dist
45        env:
46          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47
48      - name: Update Docker Hub Readme
49        uses: christian-korneck/update-container-description-action@v1
50        with:
51          destination_container_repo: charmcli/soft-serve
52          provider: dockerhub
53          short_description: "A tasty Git server 🍦"
54          readme_file: "README.md"