mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-17 13:02:18 +01:00
58 lines
1.3 KiB
YAML
58 lines
1.3 KiB
YAML
name: Build and publish Docker image
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
IMAGE_NAME: mhp
|
|
|
|
jobs:
|
|
# Push image to GitHub Packages.
|
|
# See also https://docs.docker.com/docker-hub/builds/
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-node@v3
|
|
- uses: actions/checkout@v3
|
|
- run: yarn install --frozen-lockfile
|
|
- run: yarn export
|
|
- uses: actions/cache@v2
|
|
id: restore-build
|
|
with:
|
|
path: ./out/
|
|
key: ${{ github.sha }}
|
|
|
|
push:
|
|
runs-on: ubuntu-latest
|
|
needs: [build]
|
|
permissions:
|
|
packages: write
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/cache@v2
|
|
id: restore-build
|
|
with:
|
|
path: ./out/
|
|
key: ${{ github.sha }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Log in to registry
|
|
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
push: true
|
|
tags: [ghcr.io/ajnart/mhp:latest, ghcr.io/ajnart/mhp:${{ github.ref }}] |