Extend Cleanup job to delete old traces (6+ months) #1863
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 and publish Docker Hub images | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - '[0-9].x' | |
| tags: | |
| - '[0-9]+.[0-9]+' | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| - name: Extract metadata (tags, labels) for standard image | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: computablefacts/cywise | |
| flavor: | | |
| latest=false | |
| tags: | | |
| # set latest tag only for default branch | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=ref,event=branch | |
| type=pep440,pattern={{version}} | |
| type=pep440,pattern={{major}}.{{minor}} | |
| type=pep440,pattern={{major}} | |
| type=sha,prefix=sha-,format=short | |
| type=sha,prefix=sha-,format=long | |
| - name: Build and push standard image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./towerify/Dockerfile | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=registry,ref=computablefacts/cywise:buildcache | |
| cache-to: type=registry,ref=computablefacts/cywise:buildcache,mode=max | |
| - name: Extract metadata (tags, labels) for performa image | |
| id: meta_performa | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: computablefacts/cywise-performa | |
| flavor: | | |
| latest=false | |
| tags: | | |
| # set latest tag only for default branch | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=ref,event=branch | |
| type=pep440,pattern={{version}} | |
| type=pep440,pattern={{major}}.{{minor}} | |
| type=pep440,pattern={{major}} | |
| type=sha,prefix=sha-,format=short | |
| type=sha,prefix=sha-,format=long | |
| - name: Build and push performa image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./performa | |
| file: ./performa/towerify/Dockerfile | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta_performa.outputs.tags }} | |
| labels: ${{ steps.meta_performa.outputs.labels }} | |
| cache-from: type=registry,ref=computablefacts/cywise-performa:buildcache | |
| cache-to: type=registry,ref=computablefacts/cywise-performa:buildcache,mode=max |