Workflow file for this run
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: Docker (optional) | ||
| on: | ||
| push: | ||
| branches: [ main, master, guardian-beacon ] | ||
| pull_request: | ||
| workflow_dispatch: | ||
| jobs: | ||
| docker: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| # Logowanie tylko jeśli są sekrety | ||
| - name: Log in to Docker Hub (optional) | ||
| if: ${{ secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN }} | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| - name: Set up QEMU | ||
| if: ${{ secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN }} | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: Set up Buildx | ||
| if: ${{ secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN }} | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Build & Push image (optional) | ||
| if: ${{ secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN }} | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: ${{ secrets.DOCKERHUB_USERNAME }}/guardian-beacon:latest | ||
| # Gdy sekretów nie ma – pokaż informację i zakończ sukcesem | ||
| - name: Skip message | ||
| if: ${{ ! (secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN) }} | ||
| run: echo "Skipping Docker login/push: Docker Hub secrets not configured." | ||