2024-10-20 00:45:46 -05:00
|
|
|
name: Build and Deploy docker container
|
2024-10-17 13:23:20 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: main
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
cancel-in-progress: false
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2024-10-20 10:08:18 -05:00
|
|
|
env:
|
|
|
|
RUNNER_TOOL_CACHE: /toolcache
|
2024-10-17 13:23:20 -05:00
|
|
|
steps:
|
2024-10-27 19:29:52 -05:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
2024-10-27 18:12:58 -05:00
|
|
|
-
|
|
|
|
uses: actions/setup-go@v3
|
2024-10-20 10:08:18 -05:00
|
|
|
with:
|
2024-10-27 18:12:58 -05:00
|
|
|
go-version: '1.20'
|
|
|
|
-
|
2024-10-27 19:14:28 -05:00
|
|
|
uses: https://gitea.com/actions/go-hashfiles@v0.0.1
|
2024-10-27 18:12:58 -05:00
|
|
|
id: get-hash
|
|
|
|
with:
|
2024-10-27 19:41:47 -05:00
|
|
|
workdir: ${{ github.workspace }}
|
2024-10-27 18:12:58 -05:00
|
|
|
patterns: |-
|
2024-10-27 19:37:44 -05:00
|
|
|
**yarn.lock
|
2024-10-27 18:12:58 -05:00
|
|
|
-
|
|
|
|
name: Echo hash
|
2024-10-27 19:35:20 -05:00
|
|
|
run: echo ${{ steps.get-hash.outputs.hash }} && echo ${{ steps.get-hash.outputs.matched-files }}
|
2024-10-27 19:27:41 -05:00
|
|
|
|
2024-10-27 18:12:58 -05:00
|
|
|
# -
|
|
|
|
# name: Restore cache
|
|
|
|
# uses: actions/cache@v4
|
|
|
|
# with:
|
|
|
|
# path: .next/cache
|
|
|
|
# key: ${{ runner.os }}-nextjs-${{ steps.get-hash.outputs.hash('**/yarn.lock') }}-${{ steps.get-hash.outputs.hash('**/yarn.lock', '**.[jt]sx') }}
|
|
|
|
# restore-keys: |
|
|
|
|
# ${{ steps.get-hash.outputs.hash }}
|
|
|
|
# -
|
|
|
|
# name: Login to Docker Hub
|
|
|
|
# uses: docker/login-action@v3
|
|
|
|
# with:
|
|
|
|
# registry: git.jonb.io
|
|
|
|
# username: ${{ gitea.actor }}
|
|
|
|
# password: ${{ secrets.JONBIO_CI }}
|
|
|
|
# -
|
|
|
|
# name: Build and push
|
|
|
|
# uses: docker/build-push-action@v6
|
|
|
|
# with:
|
|
|
|
# push: true
|
|
|
|
# tags: git.jonb.io/jblu/jonbio:latest
|
2024-10-20 10:37:46 -05:00
|
|
|
|
2024-10-27 18:12:58 -05:00
|
|
|
# deploy:
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# env:
|
|
|
|
# RUNNER_TOOL_CACHE: /toolcache
|
|
|
|
# steps:
|
|
|
|
# -
|
|
|
|
# name: Deploy App
|
|
|
|
# uses: fjogeleit/http-request-action@v1
|
|
|
|
# with:
|
|
|
|
# url: 'http://192.168.4.11:7777/v1/update'
|
|
|
|
# method: 'GET'
|
|
|
|
# bearerToken: ${{ secrets.DEPLOYTOKEN }}
|
|
|
|
# timeout: 60000
|