mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-07-23 05:53:55 -04:00
59 lines
1.5 KiB
YAML
59 lines
1.5 KiB
YAML
name: Publish docker images
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v3.*.*"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: self-hosted
|
|
steps:
|
|
# pull code
|
|
- name: Check Out Repo
|
|
uses: actions/checkout@v3
|
|
|
|
# extract tags
|
|
- name: Prepare tags
|
|
id: prep
|
|
run: |
|
|
DOCKER_IMAGE=ghcr.io/seriousm4x/upsnap
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${VERSION:0:2},${DOCKER_IMAGE}:latest"
|
|
echo "{tags}=${TAGS}" >> ${GITHUB_OUTPUT}
|
|
|
|
# qemu
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
# docker buildx
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
# ghcr.io login
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# build and push
|
|
- name: Build and push
|
|
id: docker_build
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
push: true
|
|
tags: ${{ steps.prep.outputs.tags }}
|
|
build-args: |
|
|
VERSION=${{github.ref_name}}
|
|
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|