Remove workflow file (requires workflow scope token)

This commit is contained in:
2026-08-10 06:11:28 +08:00
parent 482298371e
commit c8cbf2f419
-73
View File
@@ -1,73 +0,0 @@
name: Build & Push to Docker Hub
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
env:
REGISTRY: docker.io
IMAGE_NAME: ${{ vars.DOCKERHUB_USERNAME }}/email-sync-oauth2
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
if: github.event_name != "pull_request"
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != "pull_request" }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run healthcheck test
if: github.event_name == 'pull_request'
run: |
set -euo pipefail
trap 'docker compose down -v' EXIT
docker compose config --quiet
docker compose up -d
for _ in $(seq 1 18); do
status="$(docker inspect --format='{{.State.Health.Status}}' email-sync-oauth2)"
if [ "$status" = "healthy" ]; then
docker compose exec -T imapsync bash -n /sync.sh
exit 0
fi
sleep 10
done
docker compose logs
echo "Container did not become healthy" >&2
exit 1