Skip to content

Commit

Permalink
work flow
Browse files Browse the repository at this point in the history
  • Loading branch information
cycle-five committed Aug 6, 2023
1 parent 9a53180 commit ab48490
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker Workflow
on:
push:
tags: ['v*.*.*']

branches: [master]
pull_request:
branches: [master]

Expand All @@ -15,8 +15,21 @@ env:

jobs:
build:
name: Build Docker Image
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
permissions:
contents: read
steps:
- name: Repository Checkout
uses: actions/checkout@v3

- name: Build Docker Image
run: docker build . -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
push:
name: Build & Push Docker Image
runs-on: ubuntu-latest
if: github.event_name == 'push' || (github.event_name == 'workflow_call' && github.event.inputs.trigger == 'build')
permissions:
contents: read
packages: write
Expand All @@ -35,7 +48,7 @@ jobs:
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}

- name: Build & Push Docker Image
uses: docker/build-push-action@v4
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name: Dockerhub
on:
push:
tags: ['v*.*.*']

branches: [master]
pull_request:
branches: [master]

Expand All @@ -22,7 +22,8 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
push:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
-
Expand All @@ -41,5 +42,15 @@ jobs:
name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: cyclefive/cracktunes:latest
push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
tags: ${{ env.IMAGE_NAME }}:${{ github.sha }}
build:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

0 comments on commit ab48490

Please sign in to comment.