mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-19 01:00:20 -07:00
chore: add docker_build actions
This commit is contained in:
parent
fdde709a01
commit
d833495ab2
35
.github/workflows/docker_build.yml
vendored
Normal file
35
.github/workflows/docker_build.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
name: docker_build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["release"]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker_build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set env VERSION
|
||||||
|
run: |
|
||||||
|
git fetch --tags
|
||||||
|
echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: build/
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{ env.VERSION }}
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ secrets.DOCKERHUB_USERNAME }}/gtt:${{ env.VERSION }}
|
||||||
|
${{ secrets.DOCKERHUB_USERNAME }}/gtt:latest
|
9
build/Dockerfile
Normal file
9
build/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
FROM ubuntu:latest
|
||||||
|
ARG VERSION
|
||||||
|
|
||||||
|
RUN apt update && apt install -y wget libasound2-dev
|
||||||
|
RUN wget https://github.com/eeeXun/GTT/releases/download/${VERSION}/gtt-linux-amd64.tar.gz
|
||||||
|
RUN tar -xvf gtt-linux-amd64.tar.gz -C /usr/bin/
|
||||||
|
ENV TERM xterm-256color
|
||||||
|
|
||||||
|
ENTRYPOINT ["gtt"]
|
Loading…
x
Reference in New Issue
Block a user