mirror of
https://github.com/mat/besticon.git
synced 2026-07-24 20:54:00 +08:00
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
# github action to Build and publish Docker image
|
|
|
|
name: Docker
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
paths-ignore:
|
|
- Readme.markdown
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
environment: besticon-docker
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: ^1.26
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Build
|
|
run: go get github.com/mat/besticon/...
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Read VERSION
|
|
id: version
|
|
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
|
|
|
|
- name: Build and Push Multi-Platform Docker image
|
|
run: |
|
|
docker buildx build \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--build-arg VERSION="$VERSION" \
|
|
--build-arg REVISION="$GITHUB_SHA" \
|
|
-t matthiasluedtke/iconserver:latest \
|
|
-t "matthiasluedtke/iconserver:$VERSION" \
|
|
--push .
|