Skip to content

Commit

Permalink
feat: alamak, push ke repo sebelah pula
Browse files Browse the repository at this point in the history
  • Loading branch information
reacto11mecha committed Oct 7, 2024
1 parent 5ed61ad commit ea3d2a0
Showing 1 changed file with 53 additions and 53 deletions.
106 changes: 53 additions & 53 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,56 +131,56 @@ jobs:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/sora-baseline-client-chooser:${{ github.ref_name }}

update-docker-compose-repo:
needs: [web, processor, client-attendance, client-chooser]
if: |
always()
&& (contains(needs.web.result, 'success') || contains(needs.processor.result, 'success') || contains(needs.client-attendance.result, 'success') || contains(needs.client-chooser.result, 'success'))
&& !contains(needs.*.result, 'failure')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BASIC_DOCKER_CONFIG_REPO_PAT }}
repository: sora-vp/baseline-docker

- name: setup git config
run: |
git config --global user.name "github-actions"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Rename version
env:
WEB_UPDATE: ${{ needs.web.result }}
PROCESSOR_UPDATE: ${{ needs.processor.result }}
ATTENDANCE_UPDATE: ${{ needs.client-attendance.result }}
CHOOSER_UPDATE: ${{ needs.client-chooser.result }}
REF_NAME: ${{ github.ref_name }}
run: |
echo "WEB_UPDATE: $WEB_UPDATE"
echo "PROCESSOR_UPDATE: $PROCESSOR_UPDATE"
echo "ATTENDANCE_UPDATE: $ATTENDANCE_UPDATE"
echo "CHOOSER_UPDATE: $CHOOSER_UPDATE"
if [ "$WEB_UPDATE" == "success" ]; then
sed -i 's/rmecha\/sora-baseline-web:[^ ]*/rmecha\/sora-baseline-web:'"$REF_NAME"'/' docker-compose.yml
fi
if [ "$PROCESSOR_UPDATE" == "success" ]; then
sed -i 's/rmecha\/sora-baseline-processor:[^ ]*/rmecha\/sora-baseline-processor:'"$REF_NAME"'/' docker-compose.yml
fi
if [ "$ATTENDANCE_UPDATE" == "success" ]; then
sed -i 's/rmecha\/sora-baseline-client-attendance:[^ ]*/rmecha\/sora-baseline-client-attendance:'"$REF_NAME"'/' docker-compose.yml
fi
if [ "$CHOOSER_UPDATE" == "success" ]; then
sed -i 's/rmecha\/sora-baseline-client-chooser:[^ ]*/rmecha\/sora-baseline-client-chooser:'"$REF_NAME"'/' docker-compose.yml
fi
- name: Commit changes
env:
REF_NAME: ${{ github.ref_name }}
GITHUB_SHA: ${{ github.sha }}
run: |
git commit -am "bot-update: update $REF_NAME" -m "Cek commit -> https://github.com/sora-vp/baseline/commit/$GITHUB_SHA"
- name: Push 🚀
run: git push origin main
# update-docker-compose-repo:
# needs: [web, processor, client-attendance, client-chooser]
# if: |
# always()
# && (contains(needs.web.result, 'success') || contains(needs.processor.result, 'success') || contains(needs.client-attendance.result, 'success') || contains(needs.client-chooser.result, 'success'))
# && !contains(needs.*.result, 'failure')
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# token: ${{ secrets.BASIC_DOCKER_CONFIG_REPO_PAT }}
# repository: sora-vp/baseline-docker
#
# - name: setup git config
# run: |
# git config --global user.name "github-actions"
# git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
#
# - name: Rename version
# env:
# WEB_UPDATE: ${{ needs.web.result }}
# PROCESSOR_UPDATE: ${{ needs.processor.result }}
# ATTENDANCE_UPDATE: ${{ needs.client-attendance.result }}
# CHOOSER_UPDATE: ${{ needs.client-chooser.result }}
# REF_NAME: ${{ github.ref_name }}
# run: |
# echo "WEB_UPDATE: $WEB_UPDATE"
# echo "PROCESSOR_UPDATE: $PROCESSOR_UPDATE"
# echo "ATTENDANCE_UPDATE: $ATTENDANCE_UPDATE"
# echo "CHOOSER_UPDATE: $CHOOSER_UPDATE"
#
# if [ "$WEB_UPDATE" == "success" ]; then
# sed -i 's/rmecha\/sora-baseline-web:[^ ]*/rmecha\/sora-baseline-web:'"$REF_NAME"'/' docker-compose.yml
# fi
# if [ "$PROCESSOR_UPDATE" == "success" ]; then
# sed -i 's/rmecha\/sora-baseline-processor:[^ ]*/rmecha\/sora-baseline-processor:'"$REF_NAME"'/' docker-compose.yml
# fi
# if [ "$ATTENDANCE_UPDATE" == "success" ]; then
# sed -i 's/rmecha\/sora-baseline-client-attendance:[^ ]*/rmecha\/sora-baseline-client-attendance:'"$REF_NAME"'/' docker-compose.yml
# fi
# if [ "$CHOOSER_UPDATE" == "success" ]; then
# sed -i 's/rmecha\/sora-baseline-client-chooser:[^ ]*/rmecha\/sora-baseline-client-chooser:'"$REF_NAME"'/' docker-compose.yml
# fi
#
# - name: Commit changes
# env:
# REF_NAME: ${{ github.ref_name }}
# GITHUB_SHA: ${{ github.sha }}
# run: |
# git commit -am "bot-update: update $REF_NAME" -m "Cek commit -> https://github.com/sora-vp/baseline/commit/$GITHUB_SHA"
#
# - name: Push 🚀
# run: git push origin main

0 comments on commit ea3d2a0

Please sign in to comment.