Create docker-ghcr.yml

This commit is contained in:
Masashi Shibata
2021-12-29 03:34:38 +09:00
committed by c-bata
parent d0869ba518
commit 05f030fbb5
+25
View File
@@ -0,0 +1,25 @@
name: Publish a Docker image to ghcr.io
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo "REPO=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Enable buildx
uses: docker/setup-buildx-action@v1
- name: Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker build/push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ env.REPO }}:latest