rustpad/.github/workflows/ci.yml

46 lines
1.1 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
docker:
name: Docker Build and Push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name == 'push'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
platforms: |
${{ github.event_name == 'push' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
push: ${{ github.event_name == 'push' }}
build-args: GITHUB_SHA
tags: ekzhang/rustpad:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}