diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 76793d9e..3d1a1241 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,26 +6,9 @@ on: - 'v*.*.*' jobs: - ghpackages: - - runs-on: ubuntu-20.04 - - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Push to GitHub Packages - uses: docker/build-push-action@v1 - with: - username: ${{ github.actor }} - password: ${{ github.token }} - registry: docker.pkg.github.com - repository: sile-typesetter/casile/casile - tag_with_ref: true - - ghrelease: - - runs-on: ubuntu-20.04 + ghpublish: + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 @@ -47,7 +30,7 @@ jobs: name: casile-${{ env.VERSION }} path: casile*-${{ env.VERSION }}.zip - name: Publish Release - uses: softprops/action-gh-release@v0.1.5 + uses: softprops/action-gh-release@v1 with: body_path: casile-${{ env.VERSION }}.md files: | @@ -55,3 +38,12 @@ jobs: casile-${{ env.VERSION }}.tar.xz env: GITHUB_TOKEN: ${{ github.token }} + - name: Publish Docker Image to GH Pakcages + run: | + make docker-build-push + env: + DOCKER_REGISTRY: docker.pkg.github.com + DOCKER_REPO: $GITHUB_REPOSITORY/casile + DOCKER_TAG: ${{ env.VERSION }} + DOCKER_USERNAME: ${{ github.actor }} + DOCKER_PASSWORD: ${{ github.token }} diff --git a/Makefile.am b/Makefile.am index e8f260f3..f3a7748c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -209,6 +209,17 @@ casile-%.md: CHANGELOG.md sed -e '/\.\.\.v$*/,/\.\.\.v/!d' $< | \ sed -e '1,3d;N;$$!P;$$!D;$$d' > $@ +export DOCKER_REGISTRY ?= docker.io +export DOCKER_REPO ?= siletypesetter/$(_casile) +export DOCKER_TAG ?= HEAD + .PHONY: docker docker: Dockerfile hooks/build .version - IMAGE_NAME=siletypesetter/$(_casile):HEAD ./hooks/build $(VERSION) + ./hooks/build $(VERSION) + docker tag $(DOCKER_REPO):$(DOCKER_TAG) $(DOCKER_REGISTRY)/$(DOCKER_REPO):$(DOCKER_TAG) + + +.PHONY: docker-build-push +docker-build-push: docker + docker login https://$(DOCKER_REGISTRY) -u $(DOCKER_USERNAME) + docker push $(DOCKER_REGISTRY)/$(DOCKER_REPO):$(DOCKER_TAG) diff --git a/hooks/build b/hooks/build index 0b4f47c1..a8e8d793 100755 --- a/hooks/build +++ b/hooks/build @@ -22,5 +22,5 @@ docker build \ --build-arg VCS_REF="${1:-$DESC}" \ --build-arg RUNTIME_DEPS="$RUNTIME_DEPS" \ --build-arg BUILD_DEPS="$BUILD_DEPS" \ - --tag $IMAGE_NAME \ + --tag $DOCKER_REPO:$DOCKER_TAG \ ./