build(ci): gen image meta with docker/metadata-action
This commit is contained in:
parent
f51587da95
commit
2afeed8627
1 changed files with 17 additions and 12 deletions
27
.github/workflows/build.yml
vendored
27
.github/workflows/build.yml
vendored
|
|
@ -8,6 +8,10 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -44,20 +48,21 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Build image
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
run: |
|
id: meta
|
||||||
docker build . \
|
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||||
--build-arg "VERSION=${{ needs.check.outputs.version }}" \
|
with:
|
||||||
--label "BUILD_ID=${GITHUB_RUN_ID}" \
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
--label "BUILD_SERVER=${GITHUB_SERVER_URL}" \
|
tags: |
|
||||||
--label "OS=${RUNNER_OS}" \
|
type=edge
|
||||||
--tag qbittorrent
|
type=schedule,pattern={{date 'YYYYMMDD'}}
|
||||||
|
type=raw,${{ needs.check.outputs.version }}
|
||||||
|
|
||||||
- name: Save status
|
- name: Save status
|
||||||
run: docker images > ${{ github.workspace }}/images.txt
|
run: echo ${{ steps.meta.outputs.json }} > ${{ github.workspace }}/status.json
|
||||||
|
|
||||||
- name: Update status
|
- name: Update status
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: images
|
name: status
|
||||||
path: ${{ github.workspace }}/images.txt
|
path: ${{ github.workspace }}/status.json
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue