v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-28 05:20:12 -07:00
GTT/.github/workflows/docker_build.yml
2023-02-09 16:29:58 +08:00

36 lines
861 B
YAML

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