Skip to content

Commit 2b15f1e

Browse files
committed
changed gh workflow
1 parent eabc9f7 commit 2b15f1e

File tree

1 file changed

+10
-46
lines changed

1 file changed

+10
-46
lines changed

.github/workflows/build-container.yml

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,25 @@
1-
name: Build container
1+
---
2+
name: Build deployment container
23
on:
34
push:
45
branches:
5-
- master
6-
- staging
76
- prod
8-
pull_request:
9-
branches:
10-
- master
7+
- staging
118
workflow_dispatch:
129
jobs:
1310
docker:
1411
runs-on: ubuntu-22.04
15-
name: Docker Build and Push
12+
name: Docker push SHA
1613
steps:
1714
- uses: actions/checkout@v4
15+
- name: docker build
16+
run: docker build . -t metacpan/metacpan-ingest:$GITHUB_SHA
17+
- name: run Perl tests
18+
run: docker compose run ingest_test env PLACK_ENV=dev prove -lrv --jobs 2 t
1819
- name: Log in to Docker Hub
1920
uses: docker/login-action@v3
2021
with:
2122
username: ${{ secrets.DOCKER_HUB_USER }}
2223
password: ${{ secrets.DOCKER_HUB_TOKEN }}
23-
- name: Set up Docker Buildx
24-
uses: docker/setup-buildx-action@v3
25-
- name: Generate Auth Token
26-
uses: actions/create-github-app-token@v1
27-
id: app-token
28-
with:
29-
app-id: ${{ secrets.APP_ID }}
30-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
31-
- name: Build test image
32-
id: docker-build-test
33-
uses: docker/build-push-action@v5
34-
with:
35-
target: test
36-
push: false
37-
load: true
38-
cache-from: type=gha
39-
cache-to: type=gha,mode=max
40-
- name: Run Perl tests
41-
run: docker run -i ${{ steps.docker-build-test.outputs.imageid }}
42-
- name: Docker meta
43-
id: meta
44-
uses: docker/metadata-action@v5
45-
with:
46-
images: ${{ github.repository }}
47-
flavor: |
48-
latest=false
49-
tags: |
50-
type=sha,format=long,priority=1000
51-
type=ref,event=branch
52-
type=ref,event=pr
53-
type=raw,value=latest,enable={{is_default_branch}}
54-
- name: Build and push
55-
uses: docker/build-push-action@v5
56-
with:
57-
push: true
58-
tags: ${{ steps.meta.outputs.tags }}
59-
annotations: ${{ steps.meta.outputs.annotations }}
60-
cache-from: type=gha
61-
cache-to: type=gha,mode=max
24+
- name: push build to Docker hub
25+
run: docker push metacpan/metacpan-ingest:$GITHUB_SHA

0 commit comments

Comments
 (0)