MyShaarli/.github/workflows/docker-tags.yml
nodiscc eeaabc05a7
build and push docker images using github actions
- push images to https://hub.docker.com/r/shaarli/shaarli/tags using a personal access token (access tokens are not available for organizations)
- push an image tagged :latest for builds on master
- push an image with the same tag as the git tag for v*.*.* tags, and for the "release" branch
- update documentation (remove references to Travis/Drone CI
- deprecate stable and master Docker tags (ref. https://github.com/shaarli/Shaarli/issues/1453)
- add deprecation notices to CHANGELOG.md
2021-06-15 20:35:36 +02:00

32 lines
878 B
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: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: shaarli/shaarli:${{ env.REF }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}