build #247
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: build | |
| # --------------- | |
| # Control secrets | |
| # --------------- | |
| # | |
| # At the GitHub 'organisation' or 'project' level you are expected to | |
| # have the following GitHub 'Repository Secrets' defined | |
| # (i.e. via 'Settings -> Secrets'): - | |
| # | |
| # (none) | |
| # | |
| # ----------- | |
| # Environment (GitHub Environments) | |
| # ----------- | |
| # | |
| # (none) | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| tags-ignore: | |
| - '*' | |
| schedule: | |
| # Build every Sunday (0) at 4:45pm | |
| - cron: '45 16 * * 0' | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Lint Dockerfile | |
| uses: hadolint/[email protected] | |
| with: | |
| dockerfile: Dockerfile | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: Run pre-commit (all files) | |
| run: | | |
| pip install --no-cache-dir poetry=='1.8.5' | |
| poetry install --no-root --no-directory --with dev | |
| poetry run pre-commit run --all-files | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Inject slug/short variables | |
| uses: rlespinasse/github-slug-action@v5 | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set lower case owner name | |
| run: echo "owner=${OWNER,,}" >> "$GITHUB_ENV" | |
| env: | |
| OWNER: '${{ github.repository_owner }}' | |
| - name: Build and Push (Latest) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| tags: ${{ env.owner }}/squonk2-fastapi-ws-event-stream:latest | |
| push: true |