Skip to content

Commit 2780468

Browse files
committed
update docker build and push to use our standard setup
Use a single workflow for docker building and pushing, and use the reusable action to make it standardized. Leaving in a commented out step to update in k8s. Once it is set up, we can uncomment it.
1 parent 17303b3 commit 2780468

File tree

3 files changed

+46
-50
lines changed

3 files changed

+46
-50
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build container
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- staging
7+
- prod
8+
pull_request:
9+
types: [opened, synchronize, labeled]
10+
branches:
11+
- master
12+
workflow_dispatch:
13+
jobs:
14+
docker-build:
15+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'build-container')
16+
runs-on: ubuntu-22.04
17+
name: Docker Build and Push
18+
steps:
19+
- name: Generate Auth Token
20+
uses: actions/create-github-app-token@v2
21+
id: app-token
22+
with:
23+
app-id: ${{ secrets.APP_ID }}
24+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
25+
owner: metacpan
26+
- uses: actions/checkout@v4
27+
with:
28+
token: ${{ steps.app-token.outputs.token }}
29+
- uses: metacpan/metacpan-actions/docker-build-push@master
30+
id: build-push
31+
with:
32+
docker_hub_username: ${{ secrets.DOCKER_HUB_USER }}
33+
docker_hub_password: ${{ secrets.DOCKER_HUB_TOKEN }}
34+
ghcr_username: ${{ github.repository_owner }}
35+
ghcr_password: ${{ secrets.GITHUB_TOKEN }}
36+
test-target: test
37+
# - name: Update deployed image
38+
# if: steps.find-tag-names.outputs.latest
39+
# uses: metacpan/metacpan-actions/update-deployed-tag:master
40+
# with:
41+
# token: ${{ steps.app-token.outputs.token }}
42+
# app: api
43+
# environment: prod
44+
# base-tag: ${{ steps.find-tag-names.outputs.latest }}
45+
# tag: ${{ steps.find-tag-names.outputs.sha }}
46+

.github/workflows/build-deployment-container.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/build-production-container.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)