clean up logs #4
Workflow file for this run
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
on: | |
push: | |
branches: | |
- omarrida/openapi-test | |
jobs: | |
openapi: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "yarn" | |
- name: Install | |
run: yarn install | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: fernapi | |
password: ${{ secrets.FERN_API_DOCKERHUB_PASSWORD }} | |
- name: Build CLI | |
working-directory: ./generators/openapi | |
run: yarn dist:cli | |
- name: Print Version | |
if: ${{ inputs.generator != 'openapi' }} | |
run: | | |
projectVersion=$(cat generators/openapi/VERSION) | |
echo $projectVersion | |
echo "VERSION=$projectVersion" >> $GITHUB_ENV | |
- name: Print Version Dev | |
if: ${{ inputs.generator == 'openapi' }} | |
run: | | |
projectVersion=$(cat generators/openapi/VERSION) | |
commitNumber=$(git log --oneline | wc -l ) | |
sha_short=$(git rev-parse --short HEAD) | |
echo $projectVersion-$commitNumber-$sha_short | |
echo "VERSION=$projectVersion-$commitNumber-$sha_short" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./generators/openapi | |
file: ./generators/openapi/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=min | |
push: true | |
tags: fernapi/omarrida-openapi:latest |