|
| 1 | +name: 'Run Docker - Debian' |
| 2 | + |
| 3 | +# Allow run manually |
| 4 | +on: |
| 5 | + schedule: |
| 6 | + - cron: '0 0 1 * *' # This will run at 00:00 on the 1st of every month |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + working_directory: |
| 10 | + type: string |
| 11 | + description: What working directory should be passed to the script |
| 12 | + default: "containers/debian" |
| 13 | + build_context: |
| 14 | + type: string |
| 15 | + description: "The context of the build" |
| 16 | + default: "github_workspace" |
| 17 | + docker_image_name: |
| 18 | + type: string |
| 19 | + description: 'Docker Image name?' |
| 20 | + default: "terraform-azure-azdo-pipeline-templates/ubuntu" |
| 21 | + enable_debug_mode: |
| 22 | + type: boolean |
| 23 | + description: 'Whether debug mode should be enable for within the script' |
| 24 | + default: true |
| 25 | + registry_url: |
| 26 | + type: string |
| 27 | + description: 'The URL of the container registry' |
| 28 | + default: ghcr.io |
| 29 | + docker_file_name: |
| 30 | + type: string |
| 31 | + description: 'Docker file name?' |
| 32 | + default: "Dockerfile" |
| 33 | + push_docker_image: |
| 34 | + type: string |
| 35 | + description: 'Push docker image?' |
| 36 | + default: 'true' |
| 37 | + |
| 38 | +jobs: |
| 39 | + run-script: |
| 40 | + name: 'Run Script' |
| 41 | + runs-on: ubuntu-latest |
| 42 | + |
| 43 | + defaults: |
| 44 | + run: |
| 45 | + shell: pwsh |
| 46 | + |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v3 |
| 49 | + |
| 50 | + - name: Build |
| 51 | + id: run-script |
| 52 | + shell: pwsh |
| 53 | + run: | |
| 54 | + if ("${{ inputs.working_directory }}" -eq "github_workspace") |
| 55 | + { |
| 56 | + $workingDirectory = "${{ github.workspace }}" |
| 57 | + } |
| 58 | + else |
| 59 | + { |
| 60 | + $workingDirectory = "${{ inputs.working_directory }}" |
| 61 | + } |
| 62 | + |
| 63 | + .\Run-Docker.ps1 ` |
| 64 | + -WorkingDirectory $workingDirectory ` |
| 65 | + -BuildContext ${{ github.workspace }} ` |
| 66 | + -PushDockerImage ${{ inputs.push_docker_image }} ` |
| 67 | + -DebugMode ${{ inputs.enable_debug_mode }} ` |
| 68 | + -DockerImageName ${{ inputs.docker_image_name }} ` |
| 69 | + -DockerFileName ${{ inputs.docker_file_name }} ` |
| 70 | + -RegistryUsername ${{ secrets.RegistryUsername }} ` |
| 71 | + -RegistryPassword ${{ secrets.RegistryPassword }} ` |
| 72 | + -ImageOrg ${{ github.repository_owner }} |
0 commit comments