chore: close the known risks left open after the review (#49) #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SyncerD | |
| on: | |
| schedule: | |
| # Run every 3 weeks (21 days) at midnight UTC | |
| - cron: '0 0 */21 * *' | |
| workflow_dispatch: # Allow manual triggering | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - 'syncerd.yaml' | |
| - '.github/workflows/syncerd.yml' | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version: '1.26' | |
| cache: false | |
| - name: Build syncerd | |
| run: | | |
| go build -o syncerd ./main.go | |
| # IMPORTANT: SyncerD uses docker credential config for destination registry auth. | |
| # Keep only the login steps for the registries you actually use. | |
| - name: Login to GHCR | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Configure AWS credentials (ECR) | |
| continue-on-error: true | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ secrets.AWS_REGION || 'us-east-1' }} | |
| - name: Login to Amazon ECR | |
| continue-on-error: true | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| - name: Azure login (ACR) | |
| continue-on-error: true | |
| uses: azure/login@v3 | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS }} | |
| - name: Login to Azure Container Registry | |
| continue-on-error: true | |
| uses: azure/docker-login@v2 | |
| with: | |
| login-server: ${{ secrets.ACR_LOGIN_SERVER }} | |
| username: ${{ secrets.ACR_USERNAME }} | |
| password: ${{ secrets.ACR_PASSWORD }} | |
| - name: Authenticate to Google Cloud (GCR) | |
| continue-on-error: true | |
| uses: google-github-actions/auth@v3 | |
| with: | |
| credentials_json: ${{ secrets.GCP_SA_KEY }} | |
| - name: Set up gcloud (GCR) | |
| continue-on-error: true | |
| uses: google-github-actions/setup-gcloud@v3 | |
| - name: Configure Docker for GCR | |
| continue-on-error: true | |
| run: | | |
| gcloud auth configure-docker -q | |
| - name: Run syncerd | |
| env: | |
| SYNCERD_SOURCE_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| SYNCERD_SOURCE_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| SYNCERD_SOURCE_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
| SYNCERD_STATE_PATH: .syncerd-state.json | |
| SYNCERD_SLACK_WEBHOOK_URL: ${{ secrets.SYNCERD_SLACK_WEBHOOK_URL }} | |
| SYNCERD_SLACK_CHANNEL: ${{ secrets.SYNCERD_SLACK_CHANNEL }} | |
| run: | | |
| ./syncerd sync --once |