Skip to content

Commit

Permalink
Merge pull request #1825 from elementary-data/ele-4069-release-0162
Browse files Browse the repository at this point in the history
Add GitHub Actions workflow for building Docker image
  • Loading branch information
MikaKerman authored Feb 17, 2025
2 parents 2d58603 + a8aa901 commit 4f0a7a1
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build Docker image
on:
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-docker-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout Elementary
uses: actions/checkout@v4

- name: Set up QEMU for multi-platform support
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx for multi-platform support
uses: docker/setup-buildx-action@v3

- name: Log in to the container registry
uses: docker/#-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: false
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 4f0a7a1

Please # to comment.