Skip to content

use readable numbers in test #30

use readable numbers in test

use readable numbers in test #30

on: [push, pull_request]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
name: Test & Heroku Deployment & Docker
jobs:
test:
strategy:
matrix:
go-version: [1.23.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- run: go test -v ./...
heroku:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "ethkeygen"
heroku_email: "[email protected]"
healthcheck: "https://ethkeygen.herokuapp.com/health"
checkstring: "ok"
delay: 5
rollbackonhealthcheckfailed: true
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: _github
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: Heroku Deployment - ethkeygen
SLACK_MESSAGE: "https://ethkeygen.herokuapp.com/"
SLACK_USERNAME: _whyvrafvr
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
docker:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'main') }}
type=raw,event=branch,value={{branch}}
type=semver,pattern={{raw}}
type=sha,format=long
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}