2021-06-14 18:46:56 +02:00
|
|
|
name: Build/push Docker image (master/latest)
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
|
|
docker-build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up QEMU
|
2023-03-17 02:22:20 +01:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2021-06-14 18:46:56 +02:00
|
|
|
- name: Set up Docker Buildx
|
2023-03-17 02:22:20 +01:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2023-03-16 21:30:43 +01:00
|
|
|
|
2021-06-14 18:46:56 +02:00
|
|
|
- name: Login to DockerHub
|
2023-03-17 02:22:20 +01:00
|
|
|
uses: docker/login-action@v2
|
2021-06-14 18:46:56 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2023-03-13 16:32:38 +01:00
|
|
|
- name: Login to GitHub Container Registry
|
2023-03-16 21:30:43 +01:00
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-03-13 16:32:38 +01:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set shaarli version to the latest commit hash
|
|
|
|
run: sed -i "s/dev/$(git rev-parse --short HEAD)/" shaarli_version.php
|
|
|
|
|
2021-06-14 18:46:56 +02:00
|
|
|
- name: Build and push
|
|
|
|
id: docker_build
|
2023-03-17 02:22:20 +01:00
|
|
|
uses: docker/build-push-action@v3
|
2021-06-14 18:46:56 +02:00
|
|
|
with:
|
2023-03-13 16:32:38 +01:00
|
|
|
context: .
|
2021-06-14 18:46:56 +02:00
|
|
|
push: true
|
2023-03-16 21:30:43 +01:00
|
|
|
tags: |
|
|
|
|
shaarli/shaarli:latest
|
|
|
|
ghcr.io/shaarli/shaarli:latest
|
2021-06-14 18:46:56 +02:00
|
|
|
- name: Image digest
|
|
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|