Rebuild container with updated Ubuntu and J-Link. +semver:patch #56
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 Push Docker Image | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: [ | |
| opened, | |
| synchronize, | |
| reopened, | |
| ] | |
| concurrency: | |
| group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}} | |
| cancel-in-progress: true | |
| env: | |
| DOCKER_IMAGE_NAME: ghcr.io/staflsystems/stafl-devcontainer-ci | |
| jobs: | |
| build_and_push: | |
| name: Build and Push Docker Image | |
| runs-on: ubuntu-medium | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Determine Version | |
| if: github.ref == 'refs/heads/main' | |
| id: staflversion | |
| uses: StaflSystems/CustomGithubActions/DetermineVersion@main | |
| - name: Display Version | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| echo "Version: ${{steps.staflversion.outputs.full}}" | |
| - name: Build Docker image | |
| if: github.ref != 'refs/heads/main' | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ${{ github.workspace }}/stafl-devcontainer | |
| push: false | |
| tags: ghcr.io/staflsystems/stafl-devcontainer-ci | |
| platforms: linux/amd64,linux/arm64/v8 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Build and Push Docker image | |
| if: github.ref == 'refs/heads/main' | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ${{ github.workspace }}/stafl-devcontainer | |
| push: true | |
| tags: | | |
| ${{ env.DOCKER_IMAGE_NAME }}:latest | |
| ${{ env.DOCKER_IMAGE_NAME }}:${{ steps.staflversion.outputs.major }}.${{ steps.staflversion.outputs.minor }}.${{ steps.staflversion.outputs.patch }}-${{ steps.staflversion.outputs.build }} | |
| platforms: linux/amd64,linux/arm64/v8 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Create a GitHub release (main) | |
| if: github.ref == 'refs/heads/main' | |
| uses: StaflSystems/release-action@main | |
| with: | |
| tag: ${{ steps.staflversion.outputs.full }} | |
| commit: ${{ github.sha }} |