Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ahobsonsayers committed Apr 29, 2024
1 parent e02942e commit 1f1097c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build_push.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# Reusable Workflow for building and pushing a docker image
# https://docs.github.com/en/actions/using-workflows/reusing-workflows

name: Build and Push

on:
push:
branches:
- main
workflow_call:
inputs:
commit:
description: Full Commit Hash
type: string
required: true
tags:
description: Docker Image Tag(s)
type: string
required: true

jobs:
build-push:
Expand All @@ -17,6 +27,8 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit }}

- name: Setup QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -34,7 +46,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
tags: arranhs/abs-goodreads:develop
tags: arranhs/abs-tract:${{ inputs.tags }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/lint_test.yaml → .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,13 @@ jobs:

- name: Run test
run: task test

build-push:
name: Build and Push
needs: [lint, test]
if: github.event_name == 'push' && github.ref_name == 'main'
uses: ./.github/workflows/build_push.yaml
with:
commit: ${{ github.sha }}
image-tag: develop
secrets: inherit

0 comments on commit 1f1097c

Please sign in to comment.