feat(ci): add buildjet's runner for ARM build #4
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: Docker Image CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
amd-build: | |
name: Build & Deploy (AMD) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get the latest code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.CONTAINER_REGISTRY_URL }} | |
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} | |
password: ${{ secrets.CONTAINER_REGISTRY_PWD }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64 | |
build-args: VERSION=${{ secrets.PHP_VERSION }} | |
push: true | |
tags: ${{ secrets.CONTAINER_REGISTRY_URL }}/waistline-api:latest, ${{ secrets.CONTAINER_REGISTRY_URL }}/waistline-api:${{ secrets.VERSION }} | |
arm-build: | |
name: Build & Deploy (ARM) | |
runs-on: buildjet-4vcpu-ubuntu-2204-arm | |
steps: | |
- name: Get the latest code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.CONTAINER_REGISTRY_URL }} | |
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} | |
password: ${{ secrets.CONTAINER_REGISTRY_PWD }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/arm64 | |
build-args: VERSION=${{ secrets.PHP_VERSION }} | |
push: true | |
tags: ${{ secrets.CONTAINER_REGISTRY_URL }}/waistline-api:latest, ${{ secrets.CONTAINER_REGISTRY_URL }}/waistline-api:${{ secrets.VERSION }} |