Skip to content

Commit fb2a384

Browse files
committed
add docker build workflow
1 parent fffb701 commit fb2a384

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Build deployment container
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
jobs:
12+
docker:
13+
runs-on: ubuntu-22.04
14+
name: Docker Push
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Log in to Docker Hub
18+
uses: docker/login-action@v3
19+
with:
20+
username: ${{ secrets.DOCKER_HUB_USER }}
21+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
22+
- name: Build test image
23+
uses: docker/build-push-action@v2
24+
with:
25+
tags: metacpan/metacpan-api-v0-shim:test
26+
target: test
27+
push: false
28+
- name: Run Perl tests
29+
run: docker run -i metacpan/metacpan-api-v0-shim:test
30+
- name: Docker meta
31+
id: meta
32+
uses: docker/metadata-action@v5
33+
with:
34+
images: metacpan/metacpan-api-v0-shim
35+
flavour: |
36+
latest=false
37+
tags: |
38+
type=sha
39+
type=ref,event=branch
40+
type=ref,event=pr
41+
type=raw,value=latest,enable={{is_default_branch}}
42+
- run: echo '${{ steps.meta.outputs.json }}'
43+
- name: Build and push
44+
uses: docker/build-push-action@v5
45+
with:
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}
48+
annotations: ${{ steps.meta.outputs.annotations }}

0 commit comments

Comments
 (0)