Skip to content

Merge pull request #8 from tpdownes/update_hcl_v2 #10

Merge pull request #8 from tpdownes/update_hcl_v2

Merge pull request #8 from tpdownes/update_hcl_v2 #10

Workflow file for this run

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')