docs: update readme #6
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: CI | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
env: | |
REPO: "sealio" | |
BUILD_PLATFORMS: "linux/amd64,linux/arm64" | |
jobs: | |
skip: | |
timeout-minutes: 5 | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
pull-requests: read | |
actions: write | |
outputs: | |
should: ${{ steps.duplicate.outputs.should_skip }} | |
steps: | |
- name: Check Duplicate | |
id: duplicate | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
github_token: "${{ github.token }}" | |
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]' | |
do_not_skip: '["workflow_dispatch"]' | |
continue-on-error: true | |
build-and-push: | |
needs: | |
- skip | |
if: needs.skip.outputs.should != 'true' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
image: tonistiigi/binfmt:qemu-v7.0.0 | |
platforms: "arm64" | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Get Docker Metadata | |
if: ${{ github.event_name != 'pull_request' }} | |
id: metadata | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REPO }}/appilot | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.CI_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.CI_DOCKERHUB_PASSWORD }} | |
- name: Build and push image | |
uses: docker/build-push-action@v4 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
context: . | |
tags: ${{ steps.metadata.outputs.tags }} | |
platforms: ${{ env.BUILD_PLATFORMS }} | |
cache-from: | | |
type=registry,ref=${{ env.REPO }}/build-cache:appilot | |
cache-to: | | |
${{ github.event_name != 'pull_request' && format('type=registry,mode=max,oci-mediatypes=false,compression=gzip,ref={0}/build-cache:appilot,ignore-error=true', env.REPO) || '' }} |