- bump PHP to 8.3.1 and Composer to 2.6.6 (#43) #22
Workflow file for this run
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: Push to GHCR | |
on: | |
push: | |
tags: | |
- v* | |
env: | |
IMAGE_NAME: php | |
jobs: | |
push: | |
name: Push to GHCR | |
runs-on: ubuntu-20.04 | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build image | |
run: docker build . --file ./Dockerfile --tag $IMAGE_NAME | |
- name: Log into GitHub Container Registry | |
run: echo "${{ secrets.SECRET_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Push image to GitHub Container Registry | |
run: | | |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | |
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
echo IMAGE_ID=$IMAGE_ID | |
oldIFS=$IFS | |
IFS="." | |
read -a VERSION_ARRAY <<< $VERSION | |
IFS=$oldIFS | |
VERSION_PATH="${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}.${VERSION_ARRAY[2]}" | |
VERSION_MINOR="${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}" | |
VERSION_MAJOR="${VERSION_ARRAY[0]}" | |
docker tag $IMAGE_NAME $IMAGE_ID:latest | |
docker push $IMAGE_ID:latest | |
echo VERSION=$VERSION | |
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION | |
docker push $IMAGE_ID:$VERSION | |
echo VERSION_PATH=$VERSION_PATH | |
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION_PATH | |
docker push $IMAGE_ID:$VERSION_PATH | |
echo VERSION_MINOR=$VERSION_MINOR | |
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION_MINOR | |
docker push $IMAGE_ID:$VERSION_MINOR | |
echo VERSION_MAJOR=$VERSION_MAJOR | |
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION_MAJOR | |
docker push $IMAGE_ID:$VERSION_MAJOR |