Merge pull request #14 from JPTS2/0.1.12 #25
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: SAD Docker Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| schedule: | |
| # Every Sunday at 03:00 UTC | |
| - cron: '0 3 * * 0' | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: docker-rebuild-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| rebuild-docker: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Compute image name (lowercase) | |
| id: img | |
| run: | | |
| OWNER_LC=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') | |
| echo "image=ghcr.io/${OWNER_LC}/sad2xs-sad" >> "$GITHUB_OUTPUT" | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & push image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64 | |
| push: true | |
| tags: | | |
| ${{ steps.img.outputs.image }}:${{ github.sha }} | |
| ${{ steps.img.outputs.image }}:latest | |
| build-args: | | |
| SAD_SMOKE_PATH=tests/sad_installation_test.sad | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Smoke (SAD starts) using freshly pushed image | |
| run: | | |
| docker run --rm ${{ steps.img.outputs.image }}:${{ github.sha }} \ | |
| sad-smoke /opt/smoke.sad 20 |