generated from pieceowater-dev/openAPI-frontend-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae903d0
commit eaff8bf
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Compose | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
compose: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get short commit SHA | ||
id: get_sha | ||
run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
|
||
- name: Extract repository name | ||
id: extract_repo_name | ||
run: echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_ENV | ||
|
||
- name: Clone & Update repository | ||
run: | | ||
git clone https://x-access-token:${{ secrets.GIT_PAT }}@github.com/${{ github.repository_owner }}/qpay.git target-repo | ||
cd target-repo | ||
git config user.name "GitHub Actions" | ||
git config user.email "actions@github.com" | ||
sed -i "s|\(image: .*${{ env.REPO_NAME }}:\).*|\1${{ env.GIT_SHORT_SHA }}|" res/apps/${{ env.REPO_NAME }}/docker-compose.yaml | ||
git commit -am "Update Docker Compose image tag to $GIT_SHORT_SHA" | ||
git push origin main |