test self hosted runner #51
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: Build Image | |
on: | |
push: | |
branches: | |
- main | |
- test | |
jobs: | |
build-amd64: | |
name: amd64 image | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
actions: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 | |
with: | |
ref: "${{ inputs.ref }}" | |
- name: Login to registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3 | |
- name: Build and push | |
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6 | |
with: | |
push: true | |
provenance: false | |
context: "{{defaultContext}}" | |
tags: "ghcr.io/bradenrayhorn/mise:building-block-amd64-${{ github.sha }}" | |
platforms: linux/amd64 | |
cache-from: type=registry,ref=ghcr.io/bradenrayhorn/mise:buildcache-amd64 | |
cache-to: type=registry,ref=ghcr.io/bradenrayhorn/mise:buildcache-amd64,mode=max | |
build-arm64: | |
name: arm64 image | |
runs-on: [self-hosted, arm64] | |
permissions: | |
packages: write | |
actions: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 | |
with: | |
ref: "${{ inputs.ref }}" | |
- name: Login to registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3 | |
- name: Build and push | |
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6 | |
with: | |
push: true | |
provenance: false | |
context: "{{defaultContext}}" | |
tags: "ghcr.io/bradenrayhorn/mise:building-block-arm64-${{ github.sha }}" | |
platforms: linux/arm64 | |
cache-from: type=registry,ref=ghcr.io/bradenrayhorn/mise:buildcache-arm64 | |
cache-to: type=registry,ref=ghcr.io/bradenrayhorn/mise:buildcache-arm64,mode=max | |