Optimize release procedure (#94)

* Optimize docker release action

* Added ignored-path on CI
This commit is contained in:
Nova Kwok 2022-01-05 11:02:28 +08:00 committed by GitHub
parent 74b0382ab6
commit 3890db9077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 5 deletions

View File

@ -1,6 +1,10 @@
name: CI name: CI check on every push
on: on:
push: push:
paths-ignore:
- '**.md'
- 'Makefile'
- 'config.json'
jobs: jobs:
ci: ci:

View File

@ -1,10 +1,14 @@
name: Release Binaries
on: on:
push: push:
paths-ignore:
- '**.md'
- 'Makefile'
- 'config.json'
tags: tags:
- '*' - '*'
name: Release Binaries
jobs: jobs:
build: build:
name: Create Release name: Create Release

View File

@ -1,8 +1,14 @@
name: build docker image name: Build and release docker images
on: on:
push: push:
paths-ignore:
- '**.md'
- 'Makefile'
- 'config.json'
branches: branches:
- 'master' - 'master'
tags:
- '*'
jobs: jobs:
docker: docker:
@ -13,6 +19,9 @@ jobs:
with: with:
submodules: true submodules: true
- name: Get the tag name
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
@ -46,7 +55,8 @@ jobs:
with: with:
string: ${{ github.event.repository.full_name }} string: ${{ github.event.repository.full_name }}
- name: Build and push - name: Build and push latest images
if: ${{ github.ref == 'refs/heads/master' }}
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
@ -61,6 +71,22 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Build and push tagged images
if: ${{ github.ref != 'refs/heads/master' }}
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/arm,linux/amd64,linux/arm64
push: true
tags: |
webpsh/webp_server_go:${{ env.TAG }}
webpsh/webp-server-go:${{ env.TAG }}
webpsh/webps:${{ env.TAG }}
ghcr.io/${{ steps.ghcr_string.outputs.lowercase }}:${{ env.TAG }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache - name: Move cache
run: | run: |
rm -rf /tmp/.buildx-cache rm -rf /tmp/.buildx-cache