Skip to content

Build and push final image #127

Build and push final image

Build and push final image #127

name: Build and push final image
on:
push:
branches: [ main ]
paths:
- docker/**
pull_request:
branches: [ main ]
inputs:
tag_name:
description: 'Tag Name'
required: false
default: 'latest'
type: string
workflow_dispatch:
inputs:
tag_name:
description: 'Tag Name'
required: false
default: 'latest'
type: string
jobs:
deps:
uses: ./.github/workflows/docker_deps_image.yml
with:
tag_name: ${{inputs.tag_name}}
docker-auth-token: ${{ env.docker-auth-token }}

Check failure on line 28 in .github/workflows/docker_image_main_branch.yml

View workflow run for this annotation

GitHub Actions / Build and push final image

Invalid workflow file

The workflow is not valid. .github/workflows/docker_image_main_branch.yml (Line: 28, Col: 26): Unrecognized named-value: 'env'. Located at position 1 within expression: env.docker-auth-token .github/workflows/docker_image_main_branch.yml (Line: 29, Col: 5): Unexpected value 'env'
env:
docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }}
troute:
needs: deps
uses: ./.github/workflows/docker_troute_image.yml
with:
tag_name: ${{inputs.tag_name}}
ngen:
needs: troute
uses: ./.github/workflows/docker_ngen_image.yml
with:
tag_name: ${{inputs.tag_name}}
final:
needs: ngen
runs-on: self-hosted
steps:
- name: deploy
uses: actions/checkout@v2
- name: Build and push Docker image
uses: ./.github/action_templates/build-and-push
with:
docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }}
github-sha: ${{ github.sha }}
image-name: "ciroh-ngen-image"
dockerfile-name: "Dockerfile"
check_result:
needs: ngen
runs-on: self-hosted
outputs:
output1: ${{ steps.step1.outputs.result }}
steps:
- id: step1
run: echo "result=success" >> "$GITHUB_OUTPUT"
slack:
runs-on: self-hosted
if: ${{ always() }}
needs: [deps, troute, ngen, final, check_result]
env:
OUTPUT: ${{needs.check_result.outputs.output1}}
steps:
- name: Set env JOBSTATUS
run: |
echo "$OUTPUT"
if [[ "success" = "$OUTPUT" ]]
then
echo "JOBSTATUS=success" >> "$GITHUB_ENV"
else
echo "JOBSTATUS=failure" >> "$GITHUB_ENV"
fi
- run: echo "$JOBSTATUS"
- name: deploy
uses: actions/checkout@v2
- name: Publish slack message
if: always()
uses: ./.github/action_templates/slack
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
job-status: ${{ env.JOBSTATUS }}
pull_request_url: ${{ github.event.pull_request.html_url }}
head_commit_url: ${{ github.event.head_commit.url }}