43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: docker build and push
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
name: 'Build'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Extract tag
|
|
id: prep
|
|
if: "startsWith(github.ref, 'refs/tags/v')"
|
|
run: |
|
|
echo ::set-output name=tags::ghcr.io/qini7-sese/ehbot:${GITHUB_REF#refs/tags/v}
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
with:
|
|
platforms: all
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
- name: Login to GHCR
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: qini7-sese
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Build docker image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: true
|
|
tags: |
|
|
ghcr.io/qini7-sese/ehbot:amd64
|
|
${{ steps.prep.outputs.tags }}
|
|
- name: Docker manifest push
|
|
run: |
|
|
docker manifest create ghcr.io/qini7-sese/ehbot:latest ghcr.io/qini7-sese/ehbot:amd64
|
|
docker manifest push ghcr.io/qini7-sese/ehbot:latest |