jonbio/.gitea/workflows/build.yml

74 lines
2.3 KiB
YAML
Raw Normal View History

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
jobs:
build:
runs-on: ubuntu-latest
steps:
2024-11-02 22:37:04 -05:00
- uses: actions/setup-go@v5
2024-11-02 21:22:56 -05:00
with:
2024-11-02 22:52:00 -05:00
go-version: 'stable'
2024-11-02 21:27:21 -05:00
- uses: actions/checkout@v4
2024-11-02 22:37:04 -05:00
- name: Install Yarn
run: npm install -g yarn
2024-11-02 21:27:21 -05:00
- name: Set Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
2024-11-02 22:37:04 -05:00
cache: 'yarn'
2024-11-02 23:35:34 -05:00
- name: Hash files for cache
uses: https://gitea.com/actions/go-hashfiles@v0.0.1
2024-11-02 21:28:57 -05:00
id: get-hash
with:
patterns: |-
**/yarn.lock
2024-11-02 21:39:57 -05:00
**/*.js
**/*.jsx
**/*.ts
**/*.tsx
2024-11-02 21:22:56 -05:00
- name: Get yarn cache directory path
id: yarn-cache-dir-path
2024-11-02 21:31:39 -05:00
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
2024-11-02 23:35:34 -05:00
- run: echo "a=$(hashFiles('**/yarn.lock'))"
# - uses: actions/cache@v4
# id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
# with:
# path: |
# ${{ steps.yarn-cache-dir-path.outputs.dir }}
# ${{ github.workspace }}/.next/cache
# key: ${{ runner.os }}-yarn-${{ steps.get-hash.outputs.hash }}
# restore-keys: |
# ${{ runner.os }}-yarn-
# - run: yarn
# - run: EXPORT=1 UNOPTIMIZED=1 yarn build
2024-11-02 21:22:56 -05:00
2024-11-02 23:35:34 -05:00
# -
# name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# -
# 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:
# context: .
# push: true
# tags: git.jonb.io/jblu/jonbio:latest
# cache-from: type=registry,ref=git.jonb.io/jblu/jonbio:buildcache
# cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=git.jonb.io/jblu/jonbio:buildcache,mode=max
# -
# 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