Merge pull request #8 from tpdownes/update_hcl_v2 #10
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: build-push | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - '*' | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v3 | |
| - name: test | |
| run: make docker-test | |
| - name: build | |
| run: docker build -t ${{ github.repository }}:latest . | |
| - name: Log in to GHCR | |
| run: | | |
| echo "${{ github.token }}" | docker login https://ghcr.io -u ${GITHUB_ACTOR} --password-stdin | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: publish-latest | |
| run: | | |
| docker tag ${{ github.repository }}:latest ghcr.io/${{ github.repository }}:latest | |
| docker push ghcr.io/${{ github.repository }}:latest | |
| if: github.ref == 'refs/heads/master' | |
| - name: publish-branch | |
| run: | | |
| docker tag ${{ github.repository }}:latest ghcr.io/${{ github.repository }}:${GITHUB_REF##*/} | |
| docker push ghcr.io/${{ github.repository }}:${GITHUB_REF##*/} | |
| if: startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/master' | |
| - name: publish-tag | |
| run: | | |
| docker tag ${{ github.repository }}:latest ghcr.io/${{ github.repository }}:${GITHUB_REF##*/} | |
| docker push ghcr.io/${{ github.repository }}:${GITHUB_REF##*/} | |
| if: startsWith(github.ref, 'refs/tags/v') |