xgo Docker #8
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: xgo Docker | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: [ master ] | |
paths: | |
- 'ci/xgo/Dockerfile' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/pangbox/pangfiles/xgo | |
tags: | | |
type=sha | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Build and export to Docker | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64 | |
load: true | |
tags: | | |
${{ steps.meta.outputs.tags }} | |
localhost/xgo:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Test Build | |
run: bash ci/xgo/xgo-build.sh localhost/xgo:latest | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |