2024-03-19 09:04:36 -04:00
|
|
|
name: Build and Push Docker(Dev)
|
2024-03-19 05:13:04 -04:00
|
|
|
|
|
|
|
on:
|
2024-03-19 10:56:23 -04:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v[0-9].[0-9].[0-9]-beta*"
|
2024-03-19 05:13:04 -04:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-push:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v5
|
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
${{ secrets.DOCKER_HUB_USERNAME }}/sub2sing-box
|
|
|
|
ghcr.io/${{ github.repository }}
|
|
|
|
tags: dev
|
|
|
|
|
|
|
|
- name: Set up Docker buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
- name: Build and push Docker image to GHCR and Docker Hub
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
build-args: version=${{ github.sha }}
|
|
|
|
push: true
|
|
|
|
platforms: linux/amd64,linux/arm,linux/arm64
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|