X86 Build and push final image #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: X86 Build and push final image | |
on: | |
workflow_dispatch: | |
jobs: | |
deps: | |
uses: ./.github/workflows/docker_deps_image.yml | |
with: | |
runner_label: x86 | |
secrets: inherit | |
troute: | |
needs: deps | |
uses: ./.github/workflows/docker_troute_image.yml | |
with: | |
runner_label: x86 | |
secrets: inherit | |
ngen: | |
needs: troute | |
uses: ./.github/workflows/docker_ngen_image.yml | |
with: | |
runner_label: x86 | |
secrets: inherit | |
final: | |
needs: ngen | |
runs-on: X86 | |
steps: | |
- name: deploy | |
uses: actions/checkout@v2 | |
- name: Build and test Docker image | |
uses: ./.github/action_templates/build-and-test | |
with: | |
docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} | |
image-name: "ciroh-ngen-image" | |
dockerfile-name: "Dockerfile" | |
platform: x86 | |
if: ${{ !startsWith(github.ref, 'refs/heads/main') }} | |
- name: Build and push Docker image | |
uses: ./.github/action_templates/build-and-push | |
with: | |
docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }} | |
image-name: "ciroh-ngen-image" | |
dockerfile-name: "Dockerfile" | |
platform: x86 | |
if: startsWith(github.ref, 'refs/heads/main') | |
check_result: | |
needs: final | |
runs-on: X86 | |
outputs: | |
output1: ${{ steps.step1.outputs.result }} | |
steps: | |
- id: step1 | |
run: echo "result=success" >> "$GITHUB_OUTPUT" | |
slack: | |
runs-on: X86 | |
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 }} |