fileinvalidation: gh actions fix and minor ui improvements (#1031) #12
Workflow file for this run
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: File Invalidation Tool Docker Image CI | |
| on: | |
| push: | |
| tags: | |
| - 'fileinvalidation-*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Get tag name | |
| id: tagname | |
| run: echo "tag=${GITHUB_REF#refs/tags/fileinvalidation-}" >> "$GITHUB_ENV" | |
| - name: Login to CERN Harbour | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: registry.cern.ch | |
| username: ${{ secrets.HARBOR_USERNAME }} | |
| password: ${{ secrets.HARBOR_TOKEN }} | |
| - name: Build the Docker Image | |
| run: | | |
| cd DMOps/file_invalidation_tool && docker build . \ | |
| --file Dockerfile \ | |
| --tag registry.cern.ch/${{ vars.HARBOR_REPOSITORY }}/file_invalidation_tool:${{ env.tag }} \ | |
| --tag registry.cern.ch/${{ vars.HARBOR_REPOSITORY }}/file_invalidation_tool:latest | |
| - name: Push Image to CERN Harbour | |
| run: | | |
| docker push registry.cern.ch/${{ vars.HARBOR_REPOSITORY }}/file_invalidation_tool:${{ env.tag }} | |
| docker push registry.cern.ch/${{ vars.HARBOR_REPOSITORY }}/file_invalidation_tool:latest | |
| okd-pipeline: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install oc | |
| uses: redhat-actions/openshift-tools-installer@v1 | |
| with: | |
| oc: "4.14" | |
| - name: Verify Installation | |
| run: oc version --client | |
| - name: Log in to OKD | |
| uses: redhat-actions/oc-login@v1 | |
| with: | |
| openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} | |
| openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | |
| insecure_skip_tls_verify: true | |
| - name: Start OKD Build | |
| run: | | |
| # Start the build from your BuildConfig | |
| # --wait blocks the action until the build finishes | |
| # --follow shows the logs in your GitHub Action console | |
| oc start-build file-invalidation-tool --follow --wait | |
| - name: Rollout Deployment | |
| run: | | |
| # Manually trigger a new rollout of the deployment | |
| oc rollout restart deployment/file-invalidation-tool | |