build(ci): gen image meta with docker/metadata-action

This commit is contained in:
Mogeko 2021-11-15 18:19:44 +00:00
parent f51587da95
commit 2afeed8627
No known key found for this signature in database
GPG key ID: B35485A88F40AD2C

View file

@ -8,6 +8,10 @@ on:
branches:
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
check:
runs-on: ubuntu-latest
@ -44,20 +48,21 @@ jobs:
with:
fetch-depth: 0
- name: Build image
run: |
docker build . \
--build-arg "VERSION=${{ needs.check.outputs.version }}" \
--label "BUILD_ID=${GITHUB_RUN_ID}" \
--label "BUILD_SERVER=${GITHUB_SERVER_URL}" \
--label "OS=${RUNNER_OS}" \
--tag qbittorrent
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=edge
type=schedule,pattern={{date 'YYYYMMDD'}}
type=raw,${{ needs.check.outputs.version }}
- name: Save status
run: docker images > ${{ github.workspace }}/images.txt
run: echo ${{ steps.meta.outputs.json }} > ${{ github.workspace }}/status.json
- name: Update status
uses: actions/upload-artifact@v2
with:
name: images
path: ${{ github.workspace }}/images.txt
name: status
path: ${{ github.workspace }}/status.json