Skip to content

Build docker image

Build docker image #2

Workflow file for this run

name: Build docker image
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get tag
id: repository
run: echo "tag=$(git describe --tags HEAD)" > $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/oca-repository
flavor: latest=true
tags: |
type=semver,pattern={{version}}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
outputs:
img-tag: ${{ steps.meta.outputs.tags }}
release:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Release
uses: ncipollo/release-action@v1
with:
body: |
### Images
- OCA-repository: [ ${{ needs.build.outputs.img-tag }} ](https://${{needs.build.outputs.img-tag}})
removeArtifacts: true
artifacts: ""