Skip to content

Commit

Permalink
add github action to create docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
NikoHadouken committed Nov 13, 2024
1 parent 90ab938 commit aeec11b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Push Docker Image to GHCR

on:
push:
tags:
- '*' # Trigger on any tag creation

jobs:
build:
runs-on: ubuntu-latest

steps:
# Check out the code
- name: Checkout repository
uses: actions/checkout@v3

# Log in to GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} # GitHub token is automatically provided

# Build the Docker image
- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}/sherpa-api-mock:${{ github.ref_name }} .
# Push the Docker image to GitHub Container Registry
- name: Push Docker image
run: |
docker push ghcr.io/${{ github.repository }}/sherpa-api-mock:${{ github.ref_name }}

0 comments on commit aeec11b

Please sign in to comment.