mirror of
https://github.com/Lifailon/lazyjournal.git
synced 2026-11-11 01:09:46 +01:00
50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
name: Docker Build and Push from specified commit
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
Commit:
|
|
description: "Commit for git checkout"
|
|
required: true
|
|
default: ""
|
|
Version:
|
|
description: "Version for docker tag"
|
|
required: true
|
|
default: ""
|
|
|
|
jobs:
|
|
build:
|
|
name: Build on ubuntu-latest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Clone main repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
ref: main
|
|
|
|
- name: Checkout the specified commit
|
|
run: git checkout ${{ github.event.inputs.Commit }}
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Install Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver: docker-container
|
|
install: true
|
|
|
|
- name: Build and push Docker images for Linux on amd64 and arm64
|
|
run: |
|
|
version=${{ github.event.inputs.Version }}
|
|
docker buildx build \
|
|
--platform linux/amd64,linux/arm64 \
|
|
-t lifailon/lazyjournal:$version \
|
|
--push .
|