Skip to content

Commit

Permalink
Revert from master
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderM91 committed Oct 17, 2024
1 parent e7c91a5 commit 60a4ae4
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ jobs:
# tags: [ "spryker/php:8.3-debian" ]
# platforms: [ "linux/amd64", "linux/arm64" ]
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get the previous commit hash
id: previous_commit
if: ${{ github.ref == 'refs/heads/master' }}
run: |
PREV_COMMIT_HASH=$(git rev-parse HEAD^1)
echo "PREV_COMMIT_HASH=$PREV_COMMIT_HASH" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

Expand All @@ -82,6 +94,19 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Re-tag images with previous commit hash
if: ${{ github.ref == 'refs/heads/master' }}
run: |
PREV_HASH=${{ env.PREV_COMMIT_HASH }}
IMAGE_TAGS="${{ join(matrix.tags, ' ') }}"
for IMAGE_TAG in $IMAGE_TAGS; do
docker pull "$IMAGE_TAG"
NEW_TAG="${IMAGE_TAG}-${PREV_HASH}"
docker tag "$IMAGE_TAG" "$NEW_TAG"
echo "Re-tagged image: $NEW_TAG"
docker push $NEW_TAG
done
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
Expand Down

0 comments on commit 60a4ae4

Please sign in to comment.