-
Notifications
You must be signed in to change notification settings - Fork 22
Fix cont tag #880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix cont tag #880
Changes from all commits
d877f55
c432e57
1880fa4
c34f1fe
3af81ab
22fd1e9
d3824ab
2973611
44decff
af773fc
267383d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,20 +2,13 @@ name: Build and Push Container Image | |
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: | ||
| description: "Skip pushing container image" | ||
| required: true | ||
| default: "true" | ||
| type: choice | ||
| options: ["true", "false"] | ||
|
|
||
| repository_dispatch: | ||
| types: [publish-conda-succeeded] | ||
| workflow_run: | ||
| workflows: ["publish_conda"] | ||
| types: [completed] | ||
|
|
||
| env: | ||
| REGISTRY: ghcr.io | ||
| IMAGE_NAME: "noaa-gfdl/ubuntu-20-fre-cli-2025" | ||
| IMAGE_NAME: "noaa-gfdl/fre-cli" | ||
|
|
||
| jobs: | ||
| build-and-push: | ||
|
|
@@ -30,32 +23,35 @@ jobs: | |
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Determine image tag | ||
| - name: Fetch all tags | ||
| run: git fetch --tags | ||
|
|
||
| - name: Determine latest tag | ||
| id: set_tag | ||
| run: | | ||
| # Use the pushed tag if this is a tag ref; otherwise fall back. | ||
| if [[ "$GITHUB_REF" == refs/tags/* ]]; then | ||
| TAG="${GITHUB_REF#refs/tags/}" | ||
| elif [[ "${GITHUB_REF_NAME}" == "main" ]]; then | ||
| TAG="latest" | ||
| else | ||
| TAG="${GITHUB_SHA::7}" | ||
| fi | ||
| echo "docker_tag=$TAG" >> "$GITHUB_OUTPUT" | ||
| echo "docker_tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Show image tag | ||
| run: echo "Docker tag is ${{ steps.set_tag.outputs.docker_tag }}" | ||
|
|
||
| - name: Update fre-cli version in cylc-flow-tools.yaml | ||
| run: | | ||
| sed -i 's/^[[:space:]]*-[[:space:]]*noaa-gfdl::fre-cli==.*/ - noaa-gfdl::fre-cli==${{ steps.set_tag.outputs.docker_tag }}/' ./container-files/cylc-flow-tools.yaml | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cylc-flow-tools.yaml still contains this old tag Why not commit the version change update to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Going off of this - the hsm package could also be tagged to 1.4.0 for that hsm update (though the container that is built won't work due to the lack of fregrid) |
||
|
|
||
| - name: Log in to the Container registry | ||
| if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' }} | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push Docker image | ||
| if: ${{ inputs.dry_run != 'true' }} | ||
| - name: Build Docker image | ||
| if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') }} | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| file: ./container-files/Dockerfile-fre-cli | ||
| push: true | ||
| push: ${{ github.event_name == 'workflow_run' }} | ||
| tags: | | ||
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.set_tag.outputs.docker_tag }} | ||
Uh oh!
There was an error while loading. Please reload this page.