Skip to content

Fix GitHub workflow (login as github.actor). #4

Fix GitHub workflow (login as github.actor).

Fix GitHub workflow (login as github.actor). #4

Workflow file for this run

name: 'Build Docker images'
on:
push:
branches: [main]
env:
STABLE_VERSION: '2.26'
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
defaults:
run:
working-directory: ${{ env.STABLE_VERSION }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: false
- name: Extract Docker metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=true
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ${{ env.STABLE_VERSION }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.STABLE_VERSION }}
labels: ${{ steps.metadata.outputs.labels }}