Skip to content

Update download of git changed script #8

Update download of git changed script

Update download of git changed script #8

Workflow file for this run

name: Release
on:
push:
# Publish `v1.2.3` tags as releases.
tags:
- v*
env:
IMAGE_NAME: fixinator
jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
#login to docker hub
echo "${{ secrets.DOCKER_PASS }}" | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin
#publish to docker hub
docker tag fixinator foundeo/fixinator:latest
docker push foundeo/fixinator:latest
date_version=$(date +%Y.%m)
docker tag fixinator foundeo/fixinator:$date_version
docker push foundeo/fixinator:$date_version
docker tag fixinator foundeo/fixinator:$VERSION
docker push foundeo/fixinator:$VERSION
docker logout
# publish on github docker registry
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
docker tag $IMAGE_NAME $IMAGE_ID:latest
docker push $IMAGE_ID:latest
docker tag $IMAGE_NAME $IMAGE_ID:$date_version
docker push $IMAGE_ID:$date_version
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION