-
Notifications
You must be signed in to change notification settings - Fork 42
43 lines (43 loc) · 1.42 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Pull, build docker image and push to repository
on:
workflow_call:
secrets:
GHCR_USERNAME:
required: true
GHCR_TOKEN:
required: true
outputs:
# Image name
image-name:
description: URL for docker image
value: ${{ jobs.build.outputs.image-name }}
# Image tag (version)
image-tag:
description: image tag(version)
value: ${{ jobs.build.outputs.image-tag }}
jobs:
build:
runs-on: ubuntu-latest
outputs:
image-name: "${{ steps.docker_build.outputs.imageFullName }}"
image-tag: "${{ steps.docker_build.outputs.tags }}"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# - uses: satackey/[email protected]
# # Ignore the failure of a step and avoid terminating the job.
# continue-on-error: true
- name: Build and push
id: docker_build
uses: mr-smithers-excellent/docker-build-push@v5
with:
image: ckb-explorer-api
registry: ghcr.io
githubOrg: magickbase # optional
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
- name: DeleteUselessImages
run: docker images && docker images| grep "ckb-explorer-api" | grep -v "IMAGE ID" | awk 'NR>1 {print $3}' | xargs -I {} docker rmi {}
- name: CheckImage
run: docker images && df -hT && df -ih