Skip to content

Commit

Permalink
Try to split action, prep for reusable parts
Browse files Browse the repository at this point in the history
  • Loading branch information
obscurerichard committed Nov 10, 2024
1 parent ec47631 commit a1c5afb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 16 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Docker Build and Push

on: workflow_dispatch

inputs:

org:
description: 'Docker Hub organization'
default: ${{ github.event.org.login }}

repo:
description: 'Docker Hub repository name'
default: ${{ github.event.repository.name }}

tag:
description: 'tag for Docker container'
default: ${{ GITHUB_SHA }}

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ org }}/${{ repo }}:${{ tag }}
20 changes: 4 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,11 @@ on: [push, pull_request]

jobs:
docker:

runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
name: Build
uses: freezingsaddles/freezing-web/.github/workflows/docker-build.yml@github-actions-docker-build
with:
push: true
tags: freezingsaddles/freezing-web:latest-actions-build
tag: latest-actions-build

0 comments on commit a1c5afb

Please sign in to comment.