Skip to content

Commit

Permalink
setup worflow to push docker image to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
Elwizzy12 committed Nov 14, 2024
1 parent f90a804 commit aa11ff3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and Push Docker Image
on:
# Trigger the workflow only when a pull request is merged into main
pull_request:
branches:
- main
types:
- closed
jobs:
build:
# Run this job only if the pull request is actually merged
if: github.event.pull_request.merged == true

runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker image
run: |
docker build -t ghcr.io/adorsys-gis/webank-online-banking:latest .
- name: Push Docker image to GHCR
run: |
docker push ghcr.io/adorsys-gis/webank-online-banking:latest

0 comments on commit aa11ff3

Please sign in to comment.