Files
concrete/.github/workflows/docker-zamalang.yml
2021-10-07 14:38:50 +01:00

42 lines
1.2 KiB
YAML

name: Docker image
on:
push:
branches:
- master
release:
types: [created]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build_publish:
name: Build & Publish the Docker image
runs-on: ubuntu-latest
env:
IMAGE: ghcr.io/zama-ai/zamalang-compiler
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: login
run: echo "${{ secrets.GHCR_PASSWORD }}" | docker login -u ${{ secrets.GHCR_LOGIN }} --password-stdin ghcr.io
- name: build
run: docker image build --no-cache --label "commit-sha=${{ github.sha }}" -t $IMAGE -f builders/Dockerfile.zamalang-env .
- name: tag and publish
run: |
docker image tag $IMAGE $IMAGE:${{ github.sha }}
docker image push $IMAGE:latest
docker image push $IMAGE:${{ github.sha }}
- name: tag and publish release image
if: github.event_name == 'release'
run: |
docker image tag $IMAGE $IMAGE:${{ github.event.release.tag_name }}
docker image push $IMAGE:${{ github.event.release.tag_name }}