Skip to content

Commit

Permalink
github: devcontainer support force build parameter [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed Dec 6, 2023
1 parent 6dd5598 commit a096684
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/devcontainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ name: build devcontainer image
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
force:
required: true
type: boolean
default: false

env:
DIST: bookworm
Expand All @@ -26,12 +31,14 @@ jobs:
run: echo ${{ github.sha }}

- name: Get changed files
if: ${{ ! inputs.force }}
id: changed-files
uses: tj-actions/changed-files@v40
with:
since_last_remote_commit: true

- name: changes in relevant files
if: ${{ ! inputs.force }}
id: changed-files-builder
uses: tj-actions/changed-files@v40
with:
Expand All @@ -40,15 +47,15 @@ jobs:
pkg/kamailio/deb/${{ env.DIST }}/**
- name: Login to GitHub Container Registry
if: steps.changed-files-builder.outputs.any_changed == 'true'
if: steps.changed-files-builder.outputs.any_changed == 'true' || inputs.force
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pre-build dev container image
if: steps.changed-files-builder.outputs.any_changed == 'true'
if: steps.changed-files-builder.outputs.any_changed == 'true' || inputs.force
uses: devcontainers/ci@v0.3
with:
imageName: ghcr.io/${{ github.repository_owner }}/kamailio-${{ github.ref_name }}-devcontainer
Expand Down

0 comments on commit a096684

Please sign in to comment.