Skip to content

Commit

Permalink
add resuable build docker workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lcduong committed Aug 16, 2024
1 parent 9964416 commit ccda3b0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/docker-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ on:
branches: [development, master]

jobs:
build_docker_image:
name: Build Docker image
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build Docker image
run: docker build --build-arg GITHUB_TOKEN=${{ secrets.EVENTYAY_TOKEN }} -t eventyay-ticket:${{ github.sha }} .
call_reusable_workflow:
uses: ./.github/workflows/reusable-docker-build.yml@main
secrets:
EVENTYAY_TOKEN: ${{ secrets.EVENTYAY_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/reusable-docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Reusable Docker Build Workflow

on:
workflow_call:
secrets:
EVENTYAY_TOKEN:
required: true

jobs:
build_docker_image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: false
tags: eventyay-ticket:${{ github.sha }}
build-args: GITHUB_TOKEN=${{ secrets.EVENTYAY_TOKEN }}

0 comments on commit ccda3b0

Please sign in to comment.