Skip to content

Support Authenticating as a GitHub App installation #32

Support Authenticating as a GitHub App installation

Support Authenticating as a GitHub App installation #32

Workflow file for this run

name: Build and Push Docker Image
on:
push:
tags:
- '*'
env:
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Lowercase repo name
run: |
echo "GITHUB_REPOSITORY_LOWERCASE=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
echo "GITHUB_REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le,linux/s390x
push: true
tags: |
${{ env.REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWERCASE }}/${{ env.GITHUB_REPOSITORY_NAME }}:${{ github.ref_name }}
${{ env.REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWERCASE }}/${{ env.GITHUB_REPOSITORY_NAME }}:latest