Skip to content

add repo owner

add repo owner #3

Workflow file for this run

name: CI Image
on:
workflow_dispatch:
push:
branches:
- main
env:
REGISTRY: 'ghcr.io/${{github.repository_owner}}'
IMAGE_NAME: 'hello_client'
jobs:
ci:
name: Build and push
runs-on: ubuntu-latest
defaults:
run:
shell: bash
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Docker metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY}}/${{ env.IMAGE_NAME}}
tags: |
type=sha
flavor: |
latest=true
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY}}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max