Revert "Merge pull request #1 from skymatic/feature/php8" #11
This file contains hidden or 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: Docker | |
on: | |
push: | |
branches: [ master ] | |
tags: [ ] | |
env: | |
REPO_NAME: skymatic | |
IMAGE_NAME: apache-php-base | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag $IMAGE_NAME:$(date +%s) | |
push: | |
needs: build # Ensure build job passes before pushing image. | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build image | |
run: docker build . --file Dockerfile --tag image | |
- name: Log into registry | |
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login docker.io -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |
- name: Push image | |
run: | | |
IMAGE_ID=$REPO_NAME/$IMAGE_NAME | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
[ "$VERSION" == "master" ] && VERSION=latest | |
echo VERSION=$VERSION | |
docker tag image $REPO_NAME/$IMAGE_NAME:$VERSION | |
docker push $REPO_NAME/$IMAGE_NAME:$VERSION |