Skip to content

fix: github actions

fix: github actions #5

Workflow file for this run

name: Build and Push Docker Image
on:
push:
tags:
- "v*"
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Git tag
id: extract_tag
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
- name: Lowercase REPO
id: lower-repo
run: |
echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT
- name: Build and tag Docker image
run: |
docker build . -t ghcr.io/${{ steps.lower-repo.outputs.repository }}:${{ steps.extract_tag.outputs.tag }}
- name: Push Docker image
run: |
docker push ghcr.io/${{ steps.lower-repo.outputs.repository }}:${{ steps.extract_tag.outputs.tag }}