Skip to content

Merge pull request #195 from aipeach/patch-2 #108

Merge pull request #195 from aipeach/patch-2

Merge pull request #195 from aipeach/patch-2 #108

name: ci
on:
push:
paths-ignore:
- "resources/**"
- "README.md"
- "README-EN.md"
- ".github/ISSUE_TEMPLATE/**"
branches:
- "master"
- "dev"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set Environment Variables
run: |
IMG=fulltclash
echo "IMG=${IMG}" >> $GITHUB_ENV
echo "IMAGE=${{ secrets.DOCKERHUB_USERNAME }}/${IMG}" >> $GITHUB_ENV
- name: Get version
id: get_version
run: echo "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT
- name: Build Latest Image
if: ${{ github.ref_name == 'dev' }}
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./docker/Dockerfile
push: true
tags: |
${{ env.IMAGE }}:latest
${{ env.IMAGE }}:debian-${{ github.ref_name }}
build-args: |
GIT_Branch=${{ github.ref_name }}
- name: Build Debian Image
if: ${{ github.ref_name != 'dev' }}
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./docker/Dockerfile
push: true
tags: |
${{ env.IMAGE }}:debian-${{ github.ref_name }}
build-args: |
GIT_Branch=${{ github.ref_name }}
- name: Build Alpine Image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./docker/Dockerfile.alpine
push: true
tags: |
${{ env.IMAGE }}:alpine-${{ github.ref_name }}
${{ env.IMAGE }}:${{ steps.get_version.outputs.version }}
build-args: |
GIT_Branch=${{ github.ref_name }}