ci: add Apple M1 runner (#879) #358
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 | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
docker_images: | |
name: docker images | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: [gorse-master, gorse-server, gorse-worker, gorse-in-one] | |
steps: | |
- name: Pull source | |
uses: actions/checkout@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build docker image | |
uses: docker/build-push-action@v2.6.1 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
file: cmd/${{ matrix.image }}/Dockerfile | |
push: true | |
tags: zhenghaoz/${{ matrix.image }}:nightly | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Resolve Images on Description | |
run: | | |
sed -i -E "s/src=\"assets\//src=\"https:\/\/github.com\/gorse-io\/gorse\/raw\/master\/assets\//" README.md | |
- name: Update DockerHub Description | |
uses: peter-evans/dockerhub-description@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
repository: zhenghaoz/${{ matrix.image }} | |
windows_images: | |
name: windows images | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
image: [gorse-master, gorse-server, gorse-worker, gorse-in-one] | |
steps: | |
- name: Pull source | |
uses: actions/checkout@v1 | |
- name: Build docker image | |
run: | | |
docker login -u $env:DOCKERHUB_USERNAME -p $env:DOCKERHUB_TOKEN | |
docker build -f cmd/${{ matrix.image }}/Dockerfile.windows ` | |
-t zhenghaoz/${{ matrix.image }}:nightly-windowsservercore . | |
docker image push --all-tags zhenghaoz/${{ matrix.image }} | |
docker logout | |
env: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} |