mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-04 13:52:26 +08:00
68 lines
2.3 KiB
YAML
68 lines
2.3 KiB
YAML
name: release image & asset
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
package:
|
|
runs-on: ubuntu-16.04
|
|
steps:
|
|
- name: step0
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ^1.15
|
|
- name: step1
|
|
run: go mod download && ./dist.sh
|
|
- name: step2
|
|
uses: azure/docker-login@v1
|
|
with:
|
|
login-server: registry.cn-hangzhou.aliyuncs.com
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
- name: step3
|
|
run: |
|
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build \
|
|
&& docker build -t registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog . \
|
|
&& docker push registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog \
|
|
&& docker tag registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog:${{ github.ref }} \
|
|
&& docker push registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog:${{ github.ref }}
|
|
- name: step4
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: Release ${{ github.ref }}
|
|
draft: false
|
|
prerelease: false
|
|
- name: step5
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: eiblog-${{ github.ref }}.darwin-amd64.tar.gz
|
|
asset_name: eiblog-${{ github.ref }}.darwin-amd64.tar.gz
|
|
asset_content_type: application/gzip
|
|
- name: step6
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: eiblog-${{ github.ref }}.linux-amd64.tar.gz
|
|
asset_name: eiblog-${{ github.ref }}.linux-amd64.tar.gz
|
|
asset_content_type: application/gzip
|
|
- name: step7
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: eiblog-${{ github.ref }}.windows-amd64.tar.gz
|
|
asset_name: eiblog-${{ github.ref }}.windows-amd64.tar.gz
|
|
asset_content_type: application/gzip
|