Skip to content

Commit 739334f

Browse files
committed
update workflow
1 parent 13a7362 commit 739334f

3 files changed

Lines changed: 54 additions & 34 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "Build and Publish Docker"
2+
permissions:
3+
contents: read
4+
5+
on:
6+
release:
7+
types: [published]
8+
workflow_dispatch:
9+
inputs:
10+
version:
11+
description: 'Version tag for Docker image'
12+
required: false
13+
14+
jobs:
15+
build-and-push:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v6
20+
21+
- name: Set up QEMU
22+
uses: docker/setup-qemu-action@v3
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Login to DockerHub
28+
uses: docker/login-action@v3
29+
with:
30+
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
33+
- name: Determine Docker tag
34+
id: docker_tag
35+
run: |
36+
if [ "${{ github.event_name }}" == "release" ]; then
37+
echo "TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
38+
elif [ -n "${{ github.event.inputs.version }}" ]; then
39+
echo "TAG=${{ github.event.inputs.version }}" >> $GITHUB_ENV
40+
else
41+
echo "TAG=latest" >> $GITHUB_ENV
42+
fi
43+
echo "Docker tag set to $TAG"
44+
45+
- name: Build and push Docker image
46+
env:
47+
IMAGE_NAME: dorowolf/akari-bot-webrender
48+
run: |
49+
docker buildx create --use
50+
docker buildx build \
51+
--platform linux/amd64,linux/arm64 \
52+
-t $IMAGE_NAME:$TAG \
53+
-t $IMAGE_NAME:latest \
54+
--push .

.github/workflows/docker-build-and-publish.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)