Skip to content

Commit

Permalink
Add docker image build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
filipeom committed May 13, 2024
1 parent b1de4ba commit dce74fa
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Image CI

on:
push:
branches: [ docker/* ]

jobs:
login:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set Branch Name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/docker/})" >> $GITHUB_ENV

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build the Docker image
run: |
docker build . -t ghcr.io/${{ github.repository }}:${{ env.BRANCH_NAME }}
docker push ghcr.io/${{ github.repository }}:${{ env.BRANCH_NAME }}

0 comments on commit dce74fa

Please sign in to comment.