run on my fork #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Docker | |
# This workflow builds and pushes docker images to dockerhub | |
# | |
# Summary | |
# | |
# job docker-os-matrix: | |
# * creates tags <version>-alpine, <version>-debian and <version>-ubuntu for each release | |
# * creates tags <branch_name>-alpine, <branch_name>-debian and <branch_name>-ubuntu for all triggered branches | |
# * creates tags current-alpine, current-debian and current-ubuntu for releasebranch_8_3 | |
# * creates tag latest for last stable release with ubuntu os | |
on: | |
push: | |
branches: | |
- main | |
- releasebranch_* | |
- '!releasebranch_7_*' | |
# tags: ['*.*.*'] | |
paths-ignore: [doc/**] | |
release: | |
types: [published] | |
jobs: | |
# Run for push to configured branches and all published releases. | |
# Take care of different os. | |
# For main branch, created tags are: | |
# main-alpine, main-debian, main-ubuntu | |
# For releasebranch_8_3, created tags are: | |
# current-alpine, current-debian, current-ubuntu, | |
# releasebranch_8_3-alpine, releasebranch_8_3-debian, releasebranch_8_3-ubuntu | |
# For a release, e.g. 8.3.0, created tags are: | |
# 8.3.0-alpine, 8.3.0-debian, 8.3.0-ubuntu and latest (with ubuntu) | |
docker-os-matrix: | |
name: build and push ${{ matrix.os }} for ${{ github.ref }} | |
if: github.repository_owner == 'OSGeo' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: | |
- alpine | |
- debian | |
- ubuntu | |
- ubuntu_wxgui | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
with: | |
fetch-depth: 0 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 | |
with: | |
images: osgeo/grass-gis | |
tags: | | |
type=ref,event=tag | |
type=ref,event=branch | |
type=raw,value=current,enable=${{ github.ref == format('refs/heads/{0}', 'releasebranch_8_3') }} | |
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/8.3') && matrix.os == 'ubuntu' }},suffix= | |
flavor: | | |
latest=false | |
suffix=-${{ matrix.os }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 | |
- name: Login to DockerHub | |
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0 | |
with: | |
push: true | |
pull: true | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
file: docker/${{ matrix.os }}/Dockerfile | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |