74 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			74 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Build Docker Images
 | 
						|
on:
 | 
						|
  workflow_dispatch:
 | 
						|
    inputs:
 | 
						|
      debug_enabled:
 | 
						|
        description: 'Run debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'     
 | 
						|
        required: false
 | 
						|
        default:  false
 | 
						|
#      success_irc_squawk:
 | 
						|
#        description: 'Squawk to IRC on success'     
 | 
						|
#        required: false
 | 
						|
#        default:  false
 | 
						|
  push:
 | 
						|
    tags:
 | 
						|
      - '2.[0-9][0-9][0-9][0-9][0-9][0-9]'
 | 
						|
jobs:
 | 
						|
  build_docker_images:
 | 
						|
    name: Build Docker Images
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
    defaults:
 | 
						|
      run:
 | 
						|
        working-directory: /github/workspace/netdisco-docker/netdisco-docker
 | 
						|
    steps:
 | 
						|
    - name: Check out latest code
 | 
						|
      uses: actions/checkout@v1
 | 
						|
      with:
 | 
						|
        repository: 'netdisco/netdisco-docker'
 | 
						|
    - name: Get the Tag
 | 
						|
      id: get_refs
 | 
						|
      run: |
 | 
						|
        echo "TAG=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
 | 
						|
        echo "IMAGE_ROOT=netdisco:${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
 | 
						|
 | 
						|
    - name: Build netdisco-postgresql
 | 
						|
      id: build_netdisco_postgresql
 | 
						|
      run: |
 | 
						|
        cd netdisco-postgresql
 | 
						|
        docker build -t ${IMAGE_ROOT}-postgresql \
 | 
						|
              --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
 | 
						|
              --build-arg TAG=${TAG} \
 | 
						|
              --build-arg COMMITTISH=${TAG} .
 | 
						|
 | 
						|
    - name: Retag all images
 | 
						|
      run: |
 | 
						|
        for image in postgresql; do
 | 
						|
          docker tag ${IMAGE_ROOT}-$image netdisco/${IMAGE_ROOT}-$image
 | 
						|
          docker tag ${IMAGE_ROOT}-$image netdisco/netdisco:latest-$image
 | 
						|
        done
 | 
						|
 | 
						|
#    - name: IRC upload failure notification
 | 
						|
#      uses: Gottox/irc-message-action@v2
 | 
						|
#      if: (! github.event.inputs.debug_enabled) && startsWith(github.ref, 'refs/tags/')
 | 
						|
#      with:
 | 
						|
#        channel: '#netdisco'
 | 
						|
#        nickname: github-actions
 | 
						|
#        message: |-
 | 
						|
#          🤖 Failed to upload Netdisco release ${{ steps.get_refs.outputs.RELEASE_TAG }} to CPAN! 😭
 | 
						|
#          👀 https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
 | 
						|
#    - name: IRC upload success notification
 | 
						|
#      uses: Gottox/irc-message-action@v2
 | 
						|
#      if: (! github.event.inputs.debug_enabled) && startsWith(github.ref, 'refs/tags/')
 | 
						|
#      with:
 | 
						|
#        channel: '#netdisco'
 | 
						|
#        nickname: github-actions
 | 
						|
#        message: |-
 | 
						|
#          🤖 Uploaded Netdisco release ${{ steps.get_refs.outputs.RELEASE_TAG }} to CPAN 🎉
 | 
						|
 | 
						|
    - name: Setup tmate session
 | 
						|
      uses: mxschmitt/action-tmate@v3
 | 
						|
      if: always() && github.event.inputs.debug_enabled && (github.event_name == 'workflow_dispatch')
 | 
						|
      with:
 | 
						|
        sudo: true
 | 
						|
 |