Skip to content

Commit 7b73bc4

Browse files
committed
chore: autoformat publish-image.yml
1 parent 0bff7e6 commit 7b73bc4

File tree

1 file changed

+91
-87
lines changed

1 file changed

+91
-87
lines changed
Lines changed: 91 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,98 @@
11
name: Publish Docker image
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
tags:
7-
description: Image tags (e.g. "type=raw,value=foo")
8-
required: false
9-
type: string
10-
build_args:
11-
description: Build-time variables
12-
required: false
13-
type: string
14-
platforms:
15-
description: Image platforms (you can specify multiple platforms separated by comma)
16-
required: false
17-
type: string
18-
default: |
19-
linux/amd64
20-
linux/arm64/v8
21-
workflow_call:
22-
inputs:
23-
tags:
24-
description: Image tags (e.g. "type=raw,value=foo")
25-
required: false
26-
type: string
27-
build_args:
28-
description: Build-time variables
29-
required: false
30-
type: string
31-
platforms:
32-
description: Image platforms (you can specify multiple platforms separated by comma)
33-
required: false
34-
type: string
35-
default: |
36-
linux/amd64
37-
linux/arm64/v8
4+
workflow_dispatch:
5+
inputs:
6+
tags:
7+
description: Image tags (e.g. "type=raw,value=foo")
8+
required: false
9+
type: string
10+
build_args:
11+
description: Build-time variables
12+
required: false
13+
type: string
14+
platforms:
15+
description:
16+
Image platforms (you can specify multiple platforms separated by
17+
comma)
18+
required: false
19+
type: string
20+
default: |
21+
linux/amd64
22+
linux/arm64/v8
23+
workflow_call:
24+
inputs:
25+
tags:
26+
description: Image tags (e.g. "type=raw,value=foo")
27+
required: false
28+
type: string
29+
build_args:
30+
description: Build-time variables
31+
required: false
32+
type: string
33+
platforms:
34+
description:
35+
Image platforms (you can specify multiple platforms separated by
36+
comma)
37+
required: false
38+
type: string
39+
default: |
40+
linux/amd64
41+
linux/arm64/v8
3842
3943
jobs:
40-
run:
41-
name: Run
42-
runs-on: ubuntu-latest
43-
steps:
44-
- name: Check out the repo
45-
uses: actions/checkout@v4
46-
47-
# Will automatically make nice tags, see the table here https://github.com/docker/metadata-action#basic
48-
- name: Docker meta
49-
id: meta
50-
uses: docker/metadata-action@v5
51-
with:
52-
images: ghcr.io/blockscout/frontend
53-
flavor: |
54-
latest=false
55-
tags: |
56-
type=ref,event=tag
57-
${{ inputs.tags }}
58-
59-
- name: Add SHORT_SHA env property with commit short sha
60-
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
44+
run:
45+
name: Run
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Check out the repo
49+
uses: actions/checkout@v4
6150

62-
- name: Debug
63-
env:
64-
REF_TYPE: ${{ github.ref_type }}
65-
REF_NAME: ${{ github.ref_name }}
66-
run: |
67-
echo "ref_type: $REF_TYPE"
68-
echo "ref_name: $REF_NAME"
69-
70-
- name: Setup repo
71-
uses: blockscout/actions/.github/actions/setup-multiarch-buildx@no-metadata
72-
id: setup
73-
with:
74-
docker-image: ghcr.io/blockscout/frontend
75-
docker-username: ${{ github.actor }}
76-
docker-password: ${{ secrets.GITHUB_TOKEN }}
77-
docker-remote-multi-platform: true
78-
docker-arm-host: ${{ secrets.ARM_RUNNER_HOSTNAME }}
79-
docker-arm-host-key: ${{ secrets.ARM_RUNNER_KEY }}
51+
# Will automatically make nice tags, see the table here https://github.com/docker/metadata-action#basic
52+
- name: Docker meta
53+
id: meta
54+
uses: docker/metadata-action@v5
55+
with:
56+
images: ghcr.io/blockscout/frontend
57+
flavor: |
58+
latest=false
59+
tags: |
60+
type=ref,event=tag
61+
${{ inputs.tags }}
8062
81-
- name: Build and push
82-
uses: docker/build-push-action@v5
83-
with:
84-
context: .
85-
file: ./Dockerfile
86-
push: true
87-
cache-from: type=gha
88-
tags: ${{ steps.meta.outputs.tags }}
89-
platforms: ${{ inputs.platforms }}
90-
labels: ${{ steps.meta.outputs.labels }}
91-
build-args: |
92-
GIT_COMMIT_SHA=${{ env.SHORT_SHA }}
93-
GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }}
94-
${{ inputs.build_args }}
63+
- name: Add SHORT_SHA env property with commit short sha
64+
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
65+
66+
- name: Debug
67+
env:
68+
REF_TYPE: ${{ github.ref_type }}
69+
REF_NAME: ${{ github.ref_name }}
70+
run: |
71+
echo "ref_type: $REF_TYPE"
72+
echo "ref_name: $REF_NAME"
73+
74+
- name: Setup repo
75+
uses: blockscout/actions/.github/actions/setup-multiarch-buildx@no-metadata
76+
id: setup
77+
with:
78+
docker-image: ghcr.io/blockscout/frontend
79+
docker-username: ${{ github.actor }}
80+
docker-password: ${{ secrets.GITHUB_TOKEN }}
81+
docker-remote-multi-platform: true
82+
docker-arm-host: ${{ secrets.ARM_RUNNER_HOSTNAME }}
83+
docker-arm-host-key: ${{ secrets.ARM_RUNNER_KEY }}
84+
85+
- name: Build and push
86+
uses: docker/build-push-action@v5
87+
with:
88+
context: .
89+
file: ./Dockerfile
90+
push: true
91+
cache-from: type=gha
92+
tags: ${{ steps.meta.outputs.tags }}
93+
platforms: ${{ inputs.platforms }}
94+
labels: ${{ steps.meta.outputs.labels }}
95+
build-args: |
96+
GIT_COMMIT_SHA=${{ env.SHORT_SHA }}
97+
GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }}
98+
${{ inputs.build_args }}

0 commit comments

Comments
 (0)