Skip to content

Only upload builder artifacts from workflow runs triggered after merge #31

Only upload builder artifacts from workflow runs triggered after merge

Only upload builder artifacts from workflow runs triggered after merge #31

Workflow file for this run

name: Generate ubuntu-2004 images
env:
GITHUB_OUTPUT: ""
on:
push:
branches:
- main
paths:
- "docker/ubuntu-2004-builder.Dockerfile"
- ".github/workflows/ubuntu-2004.yml"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "docker/ubuntu-2004-builder.Dockerfile"
- ".github/workflows/ubuntu-2004.yml"
jobs:
ubuntu-2004-builder:
name: psibase-builder-ubuntu-2004
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: false
fetch-depth: 0
- name: Preparation
id: prep
run: |
REGISTRY="ghcr.io"
IMAGE="${REGISTRY}/${{ github.repository_owner }}/psibase-builder-ubuntu-2004"
TAGS="${IMAGE}:${{ github.sha }}"
echo "tags=${TAGS,,}" >> $GITHUB_OUTPUT
- name: Showtag
id: showtag
run: echo ${{ steps.prep.outputs.tags }}
- name: Docker Buildx setup
uses: docker/setup-buildx-action@v2
with:
buildkitd-flags: --debug
- name: Login in to registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Publish Image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
file: docker/ubuntu-2004-builder.Dockerfile
tags: ${{ steps.prep.outputs.tags }}
platforms: linux/amd64
outputs: type=image,annotation-index.org.opencontainers.image.description=Psibase build environment based on Ubuntu 20.04 (amd64)