capitalize logs and extract consts #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
env: | |
DOCKERHUB_NAME: marschine | |
GH_IMAGE_NAME: ghcr.io/${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Generate image tag | |
run: echo "TAG=$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: Build Docker image | |
run: docker build -t ${{ env.GH_IMAGE_NAME }}:latest -t ${{ env.GH_IMAGE_NAME }}:${{ env.TAG }} . | |
- name: Log into registry ghcr.io | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push image to ghcr.io | |
run: | | |
docker push ${{ env.GH_IMAGE_NAME }}:latest | |
docker push ${{ env.GH_IMAGE_NAME }}:${{ env.TAG }} |