feat: Backup support #1109
This file contains 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: Build docker image | |
# Add concurrency configuration to handle multiple pushes | |
concurrency: | |
group: docker-build-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
schedule: | |
# Runs at 02:00 UTC every day | |
- cron: '0 2 * * *' | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
# Only run on push to main branch | |
- main | |
jobs: | |
golangci: | |
uses: ./.github/workflows/golangci-lint.yml | |
build-and-push-docker-image: | |
needs: golangci | |
if: github.event_name == 'push' && github.ref_name == 'main' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout GitHub Action | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate downcase repository name | |
run: | | |
echo "REPO=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/${{ env.REPO }}:dev | |
ghcr.io/${{ env.REPO }}:${{ github.sha }} | |
platforms: linux/arm64, linux/amd64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
provenance: false | |