Merge pull request #213 from Terradue/develop #3
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: ci-main-latest | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| permissions: | |
| id-token: write # allow OIDC tokens for authentication and artifact attestations | |
| contents: read | |
| packages: write | |
| attestations: write | |
| jobs: | |
| ci-and-container: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| pip install hatch | |
| - name: Build package | |
| run: hatch build | |
| - name: Run tests | |
| run: hatch -e test run nose2 --verbose | |
| - name: Login to GHCR | |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: Build & push latest image | |
| run: | | |
| IMAGE_ID=ghcr.io/duke-gcb/calrissian/calrissian | |
| docker build . --file Dockerfile --tag calrissian:latest | |
| docker tag calrissian:latest $IMAGE_ID:latest | |
| docker push $IMAGE_ID:latest |