Skip to content

Commit

Permalink
fix missing web commit in followup steps
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor committed Aug 25, 2024
1 parent e9d423f commit aabd85d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 6 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/build_commit_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jobs:
build:
runs-on: ubuntu-latest

outputs:
tcw_commit_hash: ${{ steps.get_commit_hash.outputs.commit_hash }}

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -91,6 +94,15 @@ jobs:
echo "No changes to commit and push."
fi
- name: Get Last Commit Hash
id: get_commit_hash
run: echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Wait for a few seconds # to avoid missing commit in followup steps
run: sleep 10

build_docker:
needs: build
uses: ./.github/workflows/publish_docker_matrix.yml
uses: ./.github/workflows/publish_docker_matrix.yml
with:
tcw_commit_hash: ${{ needs.build.outputs.tcw_commit_hash }}
21 changes: 16 additions & 5 deletions .github/workflows/publish_docker_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,32 @@ name: Docker Image Publish Matrix (All)
on:
workflow_dispatch:
workflow_call:
inputs:
tcw_commit_hash:
description: "Commit hash from the teddycloud_web build job"
type: string
required: false

push:
branches:
- master
- develop
- master
- develop
tags:
- tc_nightly*
- tc_v*.*.*
- tc_nightly*
- tc_v*.*.*
pull_request:
branches: [ "master", "develop" ]
branches: ["master", "develop"]

jobs:
debian:
uses: ./.github/workflows/publish_docker_matrix_debian.yml
with:
tcw_commit_hash: ${{ inputs.tcw_commit_hash }}
ubuntu:
uses: ./.github/workflows/publish_docker_matrix_ubuntu.yml
with:
tcw_commit_hash: ${{ inputs.tcw_commit_hash }}
alpine:
uses: ./.github/workflows/publish_docker_matrix_alpine.yml
with:
tcw_commit_hash: ${{ inputs.tcw_commit_hash }}
6 changes: 6 additions & 0 deletions .github/workflows/publish_docker_matrix_alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Docker Image Publish Matrix (Alpine)
on:
workflow_dispatch:
workflow_call:
inputs:
tcw_commit_hash:
description: "Commit hash from the teddycloud_web build job"
type: string
required: false

# permissions are needed if pushing to ghcr.io
permissions:
Expand Down Expand Up @@ -31,6 +36,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ inputs.tcw_commit_hash || 'HEAD' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish_docker_matrix_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Docker Image Publish Matrix (Debian)
on:
workflow_dispatch:
workflow_call:
inputs:
tcw_commit_hash:
description: "Commit hash from the teddycloud_web build job"
type: string
required: false

# permissions are needed if pushing to ghcr.io
permissions:
Expand Down Expand Up @@ -30,6 +35,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ inputs.tcw_commit_hash || 'HEAD' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish_docker_matrix_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Docker Image Publish Matrix (Ubuntu)
on:
workflow_dispatch:
workflow_call:
inputs:
tcw_commit_hash:
description: "Commit hash from the teddycloud_web build job"
type: string
required: false

# permissions are needed if pushing to ghcr.io
permissions:
Expand All @@ -29,6 +34,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ inputs.tcw_commit_hash || 'HEAD' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand Down

0 comments on commit aabd85d

Please sign in to comment.