diff --git a/.github/workflows/version.yaml b/.github/workflows/version.yaml new file mode 100644 index 0000000..3887d93 --- /dev/null +++ b/.github/workflows/version.yaml @@ -0,0 +1,37 @@ +name: GitHub Registry :version + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Set version tag + id: tag + run: | + VERSION_TAG=$(echo ${GITHUB_REF##*/} | sed -e "s#^v##") + echo ::set-env name=GITHUB_TAG::$VERSION_TAG + echo ::set-env name=APP_NAME::app + + - uses: actions/checkout@master + + - name: Login to github registry + uses: actions/docker/login@master + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + DOCKER_REGISTRY_URL: docker.pkg.github.com + + - name: Build image + uses: actions/docker/cli@master + with: + args: build -t docker.pkg.github.com/${GITHUB_REPOSITORY}/cli:${GITHUB_TAG} . + + - name: Push to registry + uses: actions/docker/cli@master + with: + args: push docker.pkg.github.com/${GITHUB_REPOSITORY}/cli:${GITHUB_TAG}