Skip to content

Commit

Permalink
Build docker image automatically for linux/amd64 automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
dssysolyatin committed Jul 6, 2024
1 parent 002aa74 commit f010034
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
contents: write

jobs:
build-and-upload:
build-and-upload-binary:
name: Build and upload
runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -52,16 +52,42 @@ jobs:
shell: bash
run: |
binary_name="telegram2photoprism"
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}"
mkdir "$dirname"
mv "target/${{ matrix.target }}/release/$binary_name" "$dirname"
tar -C "$dirname" -czf "$dirname.tar.gz" .
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
tar -C "$dirname" -czf "$dirname.tar.gz" .
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.ASSET }}
${{ env.ASSET }}
build-and-upload-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Get the release version from the tag
shell: bash
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64 #,linux/arm64 at the moment linux/arm64 stuck if use git action using QEMU.
push: true
tags: dssysolyatin/telegram2photoprism:${{ env.VERSION }}-amd64

0 comments on commit f010034

Please sign in to comment.