Skip to content

Commit

Permalink
Fix release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chez-shanpu committed Oct 31, 2021
1 parent 5e4b7c2 commit 6a77043
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
34 changes: 30 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
tags:
- '*'
jobs:
test:
release:
strategy:
matrix:
go-version: [ 1.17.x ]
Expand All @@ -16,13 +16,39 @@ jobs:
with:
go-version: ${{ matrix.go-version }}

- name: Checkout cod
- name: Checkout code
uses: actions/checkout@v2

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --config ./server/.
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare for image tag
id: prep
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo ::set-output name=version::${VERSION}
- name: Build and push image
uses: docker/build-push-action@v2
with:
context: ./server
file: ./server/docker/bookowl.Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/b_2109/bookowl-server:stable
ghcr.io/${{ github.repository_owner }}/b_2109/bookowl-server:${{ steps.prep.outputs.version }}
2 changes: 1 addition & 1 deletion server/.goreleaser.yaml → .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
builds:
- id: "bookowl"
dir: ./
dir: server
binary: bookowl
goos:
- linux
Expand Down

0 comments on commit 6a77043

Please sign in to comment.