Skip to content

Merge pull request #31 from pdeveltere/fix/ian_belcher #40

Merge pull request #31 from pdeveltere/fix/ian_belcher

Merge pull request #31 from pdeveltere/fix/ian_belcher #40

name: Build docker image
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-docker-image:
name: Build docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "⛛ downcase GITHUB_REPOSITORY"
run: |
echo "GITHUB_REPOSITORY=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Build docker image
run: |
if [[ ${{ github.ref }} == 'refs/heads/master' ]]; then
tag=latest
else
tag=${{ github.sha }}
fi
image="ghcr.io/${{ env.GITHUB_REPOSITORY }}:${tag}"
docker build -t "${image}" .
docker push "${image}"