Build FAST build docker image #19
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 FAST build docker image | |
| on: | |
| push: | |
| workflow_dispatch: | |
| inputs: | |
| deploy: | |
| description: Deploy to packages | |
| type: boolean | |
| required: true | |
| default: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set variables | |
| run: | | |
| FAST_VERSION=$(python3 get_latest_fast_version.py) | |
| echo "FAST_VERSION=$FAST_VERSION" >> "$GITHUB_ENV" | |
| IMAGE_NAME=fast:${FAST_VERSION}-build | |
| IMAGE_FILENAME=fast-${FAST_VERSION}-build.tar | |
| echo "IMAGE_NAME=$IMAGE_NAME" >> "$GITHUB_ENV" | |
| echo "IMAGE_FILENAME=$IMAGE_FILENAME" >> "$GITHUB_ENV" | |
| - name: Build | |
| run: | | |
| docker build . -f build.Dockerfile -t $IMAGE_NAME | |
| - name: Save docker image to file | |
| run: | | |
| docker save -o $IMAGE_FILENAME $IMAGE_NAME | |
| - name: Upload docker image file as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.IMAGE_FILENAME }} | |
| path: ${{ env.IMAGE_FILENAME }} | |
| if-no-files-found: error | |
| retention-days: 3 | |
| - name: Test image | |
| run: | | |
| docker run --rm fast:${FAST_VERSION}-build | |
| - name: Login to GitHub Container Registry | |
| if: ${{ inputs.deploy }} | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push container | |
| if: ${{ inputs.deploy }} | |
| run: | | |
| docker push fast:${FAST_VERSION}-build |