it's good to have multiple container registries, in case one decides to not be welcoming anymore to open-source projects
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: Build/push Docker image (tags/releases)
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*"
|
|
branches:
|
|
- "v*.*"
|
|
- release
|
|
jobs:
|
|
docker-build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Get the tag name
|
|
run: echo "REF=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
id: docker_build
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: true
|
|
tags: |
|
|
shaarli/shaarli:${{ env.REF }}
|
|
ghcr.io/shaarli/shaarli:${{ env.REF }}
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|