feat(runner): create /builds #38
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 images" | |
on: | |
push: | |
branches: | |
- dev | |
- master | |
tags: | |
- autoheal-* | |
- cypress-* | |
- minio-* | |
- runner-* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: Set environment | |
run: | | |
BRANCH=${GITHUB_REF#refs/heads/} | |
TAG=${GITHUB_REF#refs/tags/} | |
echo "NAME=" >> $GITHUB_ENV | |
echo "VERSION=${BRANCH//master/latest}" >> $GITHUB_ENV | |
# Support for git tags e.g. 'cypress-8.3.0' | |
if [ ${GITHUB_REF} != ${TAG} ]; then | |
echo "NAME=${TAG%-*}" >> $GITHUB_ENV | |
echo "VERSION=${TAG#*-}" >> $GITHUB_ENV | |
fi | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@master | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@master | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build autoheal | |
uses: docker/build-push-action@v2 | |
if: ${{ env.NAME == 'autoheal' || env.NAME == '' }} | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
file: ./autoheal/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ghcr.io/taitounited/autoheal:${{ env.VERSION }} | |
- name: Build minio | |
uses: docker/build-push-action@v2 | |
if: ${{ env.NAME == 'minio' || env.NAME == '' }} | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
file: ./minio/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ghcr.io/taitounited/minio:${{ env.VERSION }} | |
- name: Build runner | |
uses: docker/build-push-action@v2 | |
if: ${{ env.NAME == 'runner' || env.NAME == '' }} | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
file: ./runner/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ghcr.io/taitounited/runner:${{ env.VERSION }} | |
- name: Build cypress | |
uses: docker/build-push-action@v2 | |
if: ${{ env.NAME == 'cypress' || env.NAME == '' }} | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
file: ./cypress/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ghcr.io/taitounited/cypress:${{ env.VERSION }} |