chore(deps): update github actions all dependencies (major) #155
This file contains 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: PR Open - Build new container image | |
on: | |
# used on push for testing / development | |
# --------------------------------------------------------- | |
# push: | |
# branches: ['master', 'main', 'feat/5-deploy-frontend'] | |
pull_request: | |
# debug: remove the dev,putting build action on non existent branches for debug | |
branches: ['main'] | |
types: ['opened', 'reopened', 'edited', 'synchronize'] | |
paths-ignore: | |
- .vscode/** | |
- .gitignore | |
- LICENSE | |
- readme.md | |
- code_of_conduct.md | |
- cicd/** | |
- scripts/** | |
- .flake8 | |
- COMPLIANCE.yaml | |
- docs/** | |
- imgs/** | |
- .dockerignore | |
- demo.jenkins | |
- build.jenkins | |
- process.jenkins | |
- README.md | |
workflow_dispatch: | |
jobs: | |
# calculate the image tag / used to tag image and then for the | |
# deployment | |
CalculateImageTags: | |
defaults: | |
run: | |
shell: bash | |
name: calculateImageTag | |
runs-on: ubuntu-24.04 | |
outputs: | |
imagetag: ${{ steps.EchoTag.outputs.IMAGE_TAG}} | |
steps: | |
- name: Calculate Image Tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Echo Image Tag | |
id: EchoTag | |
shell: bash | |
run: | | |
echo ${{ steps.tag_version.outputs.new_tag }} | |
echo "IMAGE_TAG=${{ steps.tag_version.outputs.new_tag }}" >> "$GITHUB_OUTPUT" | |
TestGetImageTag: | |
# test output of image tag, and verify its been calculated correctly | |
defaults: | |
run: | |
shell: bash | |
needs: CalculateImageTags | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: GET Image Tag | |
id: getImageTag | |
shell: bash | |
env: | |
IMAGE_TAG: ${{ needs.CalculateImageTags.outputs.imagetag }} | |
run: | | |
echo image tag is: $IMAGE_TAG | |
echo event number is: ${{ github.event.number }} | |
BuildContainerImage: | |
defaults: | |
run: | |
shell: bash | |
needs: CalculateImageTags | |
name: 'Build Container Image' | |
runs-on: ubuntu-24.04 | |
env: | |
DEBUG_DEPLOY: false | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
id: checkout | |
# with: | |
# fetch-depth: 0 | |
- name: Verify tag | |
id: CalculateImageTagstep | |
shell: bash | |
env: | |
IMAGE_TAG: ${{ needs.CalculateImageTags.outputs.imagetag }} | |
run: | | |
echo image tag is $IMAGE_TAG ${{ env.IMAGE_TAG }} | |
echo event number is: ${{ github.event.number }} | |
- name: Log in to GitHub Docker Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push Client Docker Image | |
uses: docker/build-push-action@v6 | |
env: | |
IMAGE_TAG: ${{ needs.CalculateImageTags.outputs.imagetag }} | |
with: | |
push: true # Will only build if this is not here | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/snow_analysis:latest | |
ghcr.io/${{ github.repository_owner }}/snow_analysis:${{ env.IMAGE_TAG }} | |
ghcr.io/${{ github.repository_owner }}/snow_analysis:pr-${{ github.event.number }} |