update composer #19
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: Docker Build | |
on: | |
push: | |
tags: | |
branches: | |
- main | |
- development | |
jobs: | |
docker-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Wait for checks to succeed | |
uses: lewagon/wait-on-check-action@master | |
with: | |
ref: ${{ github.ref }} | |
check-name: 'Docker build' | |
running-workflow-name: 'Verify' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
allowed-conclusions: success | |
- uses: actions/checkout@v3 | |
- name: Build Image | |
run: docker build . -t ghcr.io/${{ github.repository }}:${{ github.sha }} | |
- name: Login to Registry | |
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login -u $ --password-stdin ghcr.io | |
- name: Push image | |
run: | | |
docker push ghcr.io/${{ github.repository }}:${{ github.sha }} | |
- name: Tag & Push branch image | |
run: | | |
docker image tag ghcr.io/${{ github.repository }}:${{ github.sha }} ghcr.io/${{ github.repository }}:${{ github.ref_name }} | |
docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }} | |
- name: Tag & Push latest image | |
if: github.ref_name == 'main' | |
run: | | |
docker image tag ghcr.io/${{ github.repository }}:${{ github.sha }} ghcr.io/${{ github.repository }}:latest | |
docker push ghcr.io/${{ github.repository }}:latest |