Skip to content

Commit

Permalink
fix: ci release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDevMinerTV committed Mar 16, 2023
1 parent c3db898 commit 7027f39
Showing 1 changed file with 50 additions and 4 deletions.
54 changes: 50 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: Create GitHub release

on:
release:
types:
- created
create:
tags:
- 'v*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: "${{ github.repository_owner }}/ofelia"

jobs:
release:
Expand All @@ -17,8 +21,50 @@ jobs:
uses: actions/checkout@v2

- name: Release binaries
uses: netresearch/go-release-action@master
uses: wangyoucao577/go-release-action@v1.36
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: amd64

docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

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

- name: Cache docker layers
uses: actions/cache@v2.1.4
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.service }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.service }}
${{ runner.os }}-buildx-
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
labels: |
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

0 comments on commit 7027f39

Please sign in to comment.