Skip to content

Merge pull request #269 from togoid/main #234

Merge pull request #269 from togoid/main

Merge pull request #269 from togoid/main #234

name: Build Docker Image and Publish to GHCR
on:
push:
branches:
- production
paths:
- 'docs/help.md'
- 'docs/help_ja.md'
jobs:
build_and_push:
runs-on: ubuntu-latest
env:
IMAGE_NAME: togoid
steps:
- name: checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Set env
run: echo "GIT_HASH=$(git rev-parse --short ${GITHUB_SHA})" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.GIT_HASH }}