github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/.github/workflows/llvm.yml (about)

     1  # This is the Github action to build and push the LLVM Docker image
     2  # used by the tinygo/tinygo-dev Docker image.
     3  #
     4  # It only needs to be rebuilt when updating the LLVM version.
     5  #
     6  # To update, make any needed changes to this file,
     7  # then push to the "build-llvm-image" branch.
     8  #
     9  # The needed image will be rebuilt, which will very likely take at least 1-2 hours.
    10  name: LLVM
    11  on:
    12    push:
    13      branches: [ build-llvm-image ]
    14  
    15  concurrency:
    16    group: ${{ github.workflow }}-${{ github.ref }}
    17    cancel-in-progress: true
    18  
    19  jobs:
    20    build-push-llvm:
    21      name: build-push-llvm
    22      runs-on: ubuntu-latest
    23      permissions:
    24        packages: write
    25        contents: read
    26      steps:
    27        - name: Check out the repo
    28          uses: actions/checkout@v4
    29          with:
    30            submodules: recursive
    31        - name: Set up Docker Buildx
    32          uses: docker/setup-buildx-action@v3
    33        - name: Docker meta
    34          id: meta
    35          uses: docker/metadata-action@v5
    36          with:
    37            images: |
    38              tinygo/llvm-17
    39              ghcr.io/${{ github.repository_owner }}/llvm-17
    40            tags: |
    41              type=sha,format=long
    42              type=raw,value=latest
    43        - name: Log in to Docker Hub
    44          uses: docker/login-action@v2
    45          with:
    46            username: ${{ secrets.DOCKER_HUB_USERNAME }}
    47            password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
    48        - name: Log in to Github Container Registry
    49          uses: docker/login-action@v3
    50          with:
    51            registry: ghcr.io
    52            username: ${{ github.actor }}
    53            password: ${{ secrets.GITHUB_TOKEN }}
    54        - name: Build and push
    55          uses: docker/build-push-action@v5
    56          with:
    57            target: tinygo-llvm-build
    58            context: .
    59            push: true
    60            tags: ${{ steps.meta.outputs.tags }}
    61            labels: ${{ steps.meta.outputs.labels }}
    62            cache-from: type=gha
    63            cache-to: type=gha,mode=max