teldrive/.github/workflows/build.yml
2023-12-22 16:31:36 +05:30

49 lines
No EOL
1.3 KiB
YAML

name: Build App
on:
workflow_dispatch:
push:
tags:
- '*'
env:
DOCKER_BUILDKIT: 1
jobs:
build_image:
name: Build Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Install buildx
uses: docker/setup-buildx-action@v2
with:
config: .github/buildkit.toml
- name: Login to Docker
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Vars
run: |
echo "IMAGE_NAME=ghcr.io/${GITHUB_REPOSITORY,,}/server" >> $GITHUB_ENV
COMMIT=$(git rev-parse --short "${GITHUB_SHA}")
LINK="https://github.com/${GITHUB_REPOSITORY,,}/commit/${GITHUB_SHA}"
INFO="{ \"version\": \"${GITHUB_REF_NAME}\", \"commit\": \"${COMMIT}\", \"link\": \"${LINK}\"}"
echo "$INFO" > ./ui/teldrive-ui/version.json
- name: Build Image
uses: docker/build-push-action@v3
with:
context: ./
platforms: linux/amd64,linux/arm64
pull: true
push: true
tags: ${{ env.IMAGE_NAME }}:${{ github.ref_name }} , ${{ env.IMAGE_NAME }}:latest