Add a push trigger for the github actions workflow, since manual trig… #2
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: Build and Publish Docker Images | |
on: | |
workflow_dispatch: | |
inputs: | |
custom_tag: | |
description: 'Tag for manual builds' | |
required: false | |
default: 'manual-build' | |
release: | |
types: [published] | |
push: | |
branches: | |
- docker-images | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.github_token }} | |
- name: Determine version tag | |
id: get_tag | |
run: | | |
if [ "${{ github.event_name }}" == "release" ]; then | |
echo "tag=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
if [ -z "${{ github.event.inputs.custom_tag }}" ]; then | |
echo "tag=manual-build" >> $GITHUB_ENV | |
else | |
echo "tag=${{ github.event.inputs.custom_tag }}" >> $GITHUB_ENV | |
fi | |
elif [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref_name }}" == "docker-images" ]; then | |
echo "tag=v1.0.0" >> $GITHUB_ENV | |
fi | |
shell: bash | |
- name: Build and push edgeless_con image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./edgeless_con/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
ghcr.io/edgeless-project/edgeless_con:${{ env.tag }} | |
ghcr.io/edgeless-project/edgeless_con:latest | |
- name: Build and push edgeless_orc image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./edgeless_orc/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
ghcr.io/edgeless-project/edgeless_orc:${{ env.tag }} | |
ghcr.io/edgeless-project/edgeless_orc:latest | |
- name: Build and push edgeless_node image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./edgeless_node/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
ghcr.io/edgeless-project/edgeless_node:${{ env.tag }} | |
ghcr.io/edgeless-project/edgeless_node:latest |