mirror of
https://github.com/cryptoadvance/specter-desktop.git
synced 2026-08-13 12:33:29 +02:00
50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
name: Build Docker container on push
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "*"
|
|
|
|
jobs:
|
|
build:
|
|
name: Build image
|
|
runs-on: ubuntu-24.04
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Checkout project
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set env variables
|
|
run: |
|
|
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" >> $GITHUB_ENV
|
|
REPO_OWNER=${{ github.repository_owner }}
|
|
echo "IMAGE_NAME=${REPO_OWNER,,}/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
id: qemu
|
|
|
|
- name: Setup Docker buildx action
|
|
uses: docker/setup-buildx-action@v3
|
|
id: buildx
|
|
|
|
- name: Run Docker buildx
|
|
run: |
|
|
docker buildx build \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--tag ghcr.io/$IMAGE_NAME:$BRANCH \
|
|
--cache-from type=gha \
|
|
--cache-to type=gha,mode=max \
|
|
--output "type=registry" ./
|