From 5ea1ab224fd349dea4f1dba1979caad286d6df16 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Wed, 30 Oct 2019 17:37:41 +0100 Subject: [PATCH] Add: publish stable builds on GitHub Package Registry when tagging (#4) --- .github/workflows/publish_stable.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/publish_stable.yml diff --git a/.github/workflows/publish_stable.yml b/.github/workflows/publish_stable.yml new file mode 100644 index 0000000..78a635d --- /dev/null +++ b/.github/workflows/publish_stable.yml @@ -0,0 +1,26 @@ +name: Push image + +on: + push: + tags: + - '*' + +jobs: + publish_image: + name: Publish image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Build + run: | + GITHUB_REPOSITORY_LC=$(echo "${GITHUB_REPOSITORY}" | tr [A-Z] [a-z]) + TAG=$(echo "${GITHUB_REF}" | sed 's@^refs/tags/@@') + docker build -t docker.pkg.github.com/${GITHUB_REPOSITORY_LC}/stable:${TAG} . + - name: Publish + run: | + GITHUB_REPOSITORY_LC=$(echo "${GITHUB_REPOSITORY}" | tr [A-Z] [a-z]) + TAG=$(echo "${GITHUB_REF}" | sed 's@^refs/tags/@@') + docker login docker.pkg.github.com -u publisher -p "${GITHUB_TOKEN}" + docker push docker.pkg.github.com/${GITHUB_REPOSITORY_LC}/stable:${TAG} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}