added builld step and push to github registery -debug #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go CI / Coverage | |
on: | |
push: | |
branches: | |
- master | |
env: | |
DOCKER_REGISTRY: ghcr.io | |
IMAGE_NAME: hayasashikan | |
jobs: | |
notify: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Save time | |
run: echo "ACTION_TIME=$(TZ=Asia/Tehran date +'%Y-%m-%d %H:%M:%S')" >> "$GITHUB_ENV" | |
- name: Telegram Commit Notification | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
format: markdown | |
message: | | |
*New Commit Pushed To ${{ github.repository }}* | |
_Time:_ `${{ env.ACTION_TIME }}` | |
_Branch:_ `${{ github.ref }}` | |
_Committer:_ `${{ github.actor }}` | |
Commit Message: | |
`${{ github.event.commits[0].message }}` | |
continue-on-error: false | |
- uses: actions/checkout@v3 | |
- name: Docker login | |
run: | | |
echo ${{ secrets.TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build Hayasashikan image | |
run: | | |
docker build -t $DOCKER_REGISTRY/$IMAGE_NAME/apiservice:latest -f Dockerfile . | |
docker push $DOCKER_REGISTRY/$IMAGE_NAME/apiservice:latest | |
- name: Save time | |
run: echo "ACTION_TIME=$(TZ=Asia/Tehran date +'%Y-%m-%d %H:%M:%S')" >> "$GITHUB_ENV" | |
- name: Telegram Workflow Status | |
if: always() | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
status: ${{ job.status }} | |
format: markdown | |
message: | | |
*Workflow Completed For ${{ github.repository }}* | |
_Time:_ `${{ env.ACTION_TIME }}` | |
_Workflow:_ `${{ github.workflow }}` | |
_Status:_ `${{ job.status }}` | |
_Run URL:_ [${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
continue-on-error: false |