Skip to content

Commit

Permalink
[CI] Update workflow to allow builds without pushes (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi authored Sep 23, 2022
1 parent a7da80f commit b5200e7
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name: Build and push images

on:
workflow_dispatch:
inputs:
push:
type: boolean
description: push the devcontainer images?
required: true
default: false
pull_request:
branches:
- main
paths:
- src/**.devcontainer.json
- src/**Dockerfile
- src/**/assets/**
- "!**.md"

concurrency:
group: ${{ github.workflow }}
Expand Down Expand Up @@ -45,10 +59,19 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: Set up devcontainer cli
run: npm install -g @devcontainers/cli
- name: Test build
if: ${{ github.event_name == 'pull_request' }}
run: |
PLATFORM=linux/amd64 \
SRC_NAME=r-ver \
IMAGE_NAME=${{ matrix.image_name }} \
VARIANT=${{ matrix.variant }} \
make devcontainer
- name: Build and push Docker images
if: ${{ github.event_name != 'pull_request' }}
run: |
SRC_NAME=r-ver \
IMAGE_NAME=${{ matrix.image_name }} \
VARIANT=${{ matrix.variant }} \
DEVCON_BUILD_OPTION=--push \
DEVCON_BUILD_OPTION=--push\ ${{ inputs.push }} \
make devcontainer

0 comments on commit b5200e7

Please sign in to comment.