46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
|
name: docker build and push
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
tags:
|
||
|
- 'v*'
|
||
|
|
||
|
env:
|
||
|
CARGO_NET_GIT_FETCH_WITH_CLI: true
|
||
|
|
||
|
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: Generate App Version
|
||
|
run: echo VERSIONED_TAG=`git describe --tags --always` >> $GITHUB_ENV
|
||
|
- name: Build docker image
|
||
|
uses: docker/build-push-action@v2
|
||
|
with:
|
||
|
push: true
|
||
|
platforms: linux/amd64,linux/arm64
|
||
|
tags: |
|
||
|
ghcr.io/qini7-sese/ehbot:latest
|
||
|
ghcr.io/qini7-sese/ehbot:${{ env.VERSIONED_TAG }}
|