添加 .gitea/workflows/sync_and_build.yml
This commit is contained in:
41
.gitea/workflows/sync_and_build.yml
Normal file
41
.gitea/workflows/sync_and_build.yml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
name: Sync Shadowsocks-Rust and Build Docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 18 * * *'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'Dockerfile'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync-and-build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ secrets.REGISTRY_SERVER }}/${{ gitea.repository_owner }}/gallery-docker
|
||||||
|
username: ${{ gitea.actor }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set Beijing time version
|
||||||
|
id: set_version
|
||||||
|
run: |
|
||||||
|
echo "VERSION=$(TZ='Asia/Shanghai' date +%Y%m%d-%H%M%S)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: 构建并提交ss-rust-docker镜像
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ secrets.REGISTRY_SERVER }}/${{ gitea.repository_owner }}/gallery-docker:latest
|
||||||
|
cache-from: type=registry,ref=${{ secrets.REGISTRY_SERVER }}/${{ gitea.repository_owner }}/gallery-docker:latest
|
||||||
|
cache-to: type=inline
|
||||||
Reference in New Issue
Block a user