Feature/kubernetes job runner #1
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: Container | |
| on: | |
| pull_request: | |
| push: | |
| branches: [master] | |
| env: | |
| # This repository must be private in the configured registry. | |
| IMAGE_REPOSITORY: altinity/s3gc | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: python -m pip install --disable-pip-version-check -r requirements.txt -r requirements-dev.txt | |
| - run: pytest -v | |
| - run: python deploy/kubernetes/render.py deploy/kubernetes/example.env > /tmp/s3gc-job.yaml | |
| publish: | |
| needs: test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - id: image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_REPOSITORY }}:sha-${{ github.sha }} | |
| ${{ env.IMAGE_REPOSITORY }}:latest | |
| - name: Record immutable image reference | |
| run: echo "${IMAGE_REPOSITORY}@${{ steps.image.outputs.digest }}" >> "$GITHUB_STEP_SUMMARY" |