This repository was archived by the owner on Jan 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.37 KB
/
release.yml
File metadata and controls
53 lines (43 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build and Release
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-release:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set vars
id: vars
run: |
export TZ='Asia/Shanghai'
echo "hash=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
echo "time=$(git log -1 --format=%cd --date=format-local:%Y.%m.%d.%H%M)" >> $GITHUB_OUTPUT
- name: Create environment file
run: echo "$ENV_CONTENT" > .env
env:
ENV_CONTENT: ${{ secrets.ENV_FILE }}
- name: Build Docker image
run: |
docker build -t video-app .
- name: Save Docker image to tar
run: |
docker save video-app | gzip > video-app.tar.gz
- name: Package Release
run: |
zip -j video-${{ steps.vars.outputs.hash }}.zip video-app.tar.gz docker-compose.yml
- name: Auto Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.vars.outputs.time }}-${{ steps.vars.outputs.hash }}
name: Release-${{ steps.vars.outputs.hash }}
draft: false
prerelease: false
files: video-${{ steps.vars.outputs.hash }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}