Ability to add or propose transactions #46
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: Install ledger | |
run: | | |
sudo apt-get install -y ledger | |
- name: Test | |
run: go test -v ./... | |
env: | |
GITHUB_URL: ${{ secrets.GIT_URL }} | |
GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }} | |
- name: set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: build and publish image | |
if: ${{ github.ref == 'refs/heads/main' }} | |
env: | |
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} | |
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} | |
GITHUB_SHA: ${{ github.sha }} | |
GITHUB_REF: ${{ github.ref }} | |
run: | | |
ref="$(echo ${GITHUB_REF} | cut -d'/' -f3)" | |
version=${ref}-${GITHUB_SHA:0:7}-$(date -u +%Y-%m-%dT%H:%M:%S) | |
echo "GITHUB_REF=${GITHUB_REF}, GITHUB_SHA=${GITHUB_SHA}, GIT_BRANCH=${ref}" | |
echo "version=${version}" | |
echo ${DOCKER_HUB_TOKEN} | docker login -u ${DOCKER_HUB_USER} --password-stdin | |
docker buildx build --push \ | |
--build-arg VERSION=${version} \ | |
--platform linux/amd64 \ | |
-t ${DOCKER_HUB_USER}/teledger:${ref} . | |
- name: deploy | |
if: ${{ github.ref == 'refs/heads/main' }} | |
env: | |
DEPLOYMENT_URL: ${{ secrets.DEPLOYMENT_URL }} | |
run: | | |
curl ${DEPLOYMENT_URL} |