Skip to content

Commit

Permalink
chore: improve ci
Browse files Browse the repository at this point in the history
  • Loading branch information
guesant committed Oct 29, 2024
1 parent b7cfd13 commit 0d6ee75
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "development",
"baseBranch": "next",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": {
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/prepare/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
node-version:
description: "The node version to setup"
required: true
default: "22"
default: "23"

node-registry-url:
description: "Define registry-url"
Expand Down
59 changes: 32 additions & 27 deletions .github/workflows/build-push-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,26 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}

env:

CI_CD_LOCAL_API_SERVICE_IMAGE: registry.ladesa.local/api-service
CI_CD_LOCAL_API_NPM_FETCH_DOCS_IMAGE: registry.ladesa.local/api-client-fetch-docs

CI_DEVELOPMENT_BRANCH: ${{ vars.CI_DEVELOPMENT_BRANCH }}
CI_PRODUCTION_BRANCH: ${{ vars.CI_PRODUCTION_BRANCH }}

# USADOS
ENABLE_BUILD_IMAGE: ${{ vars.ENABLE_BUILD_IMAGE }}
IMAGE_TAG_DEVELOPMENT: ${{ vars.IMAGE_TAG_DEVELOPMENT }}
IMAGE_TAG_PRODUCTION: ${{ vars.IMAGE_TAG_PRODUCTION }}

ENABLE_PUSH_IMAGE: ${{ vars.ENABLE_PUSH_IMAGE }}

REGISTRY_URL: ${{ secrets.REGISTRY_URL }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
IMAGE_NAME: ${{ vars.IMAGE_NAME }}

ENABLE_TRIGGER_DEPLOY: ${{ vars.ENABLE_TRIGGER_DEPLOY }}
DEPLOY_DISPATCH_TOKEN: ${{ secrets.DEPLOY_DISPATCH_TOKEN }}
DEPLOY_OWNER: ${{ vars.DEPLOY_OWNER }}
DEPLOY_REPOSITORY: ${{ vars.DEPLOY_REPOSITORY }}
DEPLOY_WORKFLOW: ${{ vars.DEPLOY_WORKFLOW }}
DEPLOY_BRANCH: ${{ vars.DEPLOY_BRANCH }}
IMAGE_TAG: ${{ github.ref_name }}
IMAGE_NAME_SERVICE: ${{ vars.IMAGE_NAME_SERVICE }}
IMAGE_NAME_DOCS_NPM_API_CLIENT_FETCH: ${{ vars.IMAGE_NAME_DOCS_NPM_API_CLIENT_FETCH }}

# NAO USADOS
# ENABLE_TRIGGER_DEPLOY: ${{ vars.ENABLE_TRIGGER_DEPLOY }}

# DEPLOY_DISPATCH_TOKEN: ${{ secrets.DEPLOY_DISPATCH_TOKEN }}
# DEPLOY_OWNER: ${{ vars.DEPLOY_OWNER }}
# DEPLOY_REPOSITORY: ${{ vars.DEPLOY_REPOSITORY }}
# DEPLOY_WORKFLOW: ${{ vars.DEPLOY_WORKFLOW }}
# DEPLOY_BRANCH: ${{ vars.DEPLOY_BRANCH }}

jobs:
build-and-push:
Expand All @@ -49,26 +45,35 @@ jobs:
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_TOKEN }}

- name: Build @ladesa-ro/api.service locally
- name: Build and push @ladesa-ro/api.service
if: ${{ env.ENABLE_BUILD_IMAGE == 'true' }}
uses: docker/build-push-action@v6
with:
load: true
push: false
# loas is an alias for outputs: type=docker
# please refer to <https://github.com/concourse/oci-build-task/issues/85>
# load: true
outputs: type=cacheonly
provenance: true
# platforms: amd64,linux/arm64,linux/arm/v7
platforms: amd64
push: ${{ env.ENABLE_PUSH_IMAGE == 'true' }}
target: api-service
tags: ${{ env.CI_CD_LOCAL_API_SERVICE_IMAGE }}
file: "Dockerfile"
tags: ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME_SERVICE }}:${{ env.IMAGE_TAG }}
# cache-from: type=gha
# cache-to: type=gha,mode=max

- name: Build @ladesa-ro/api-client-fetch-docs locally
- name: Build and push @ladesa-ro/api-client-fetch-docs
if: ${{ env.ENABLE_BUILD_IMAGE == 'true' }}
uses: docker/build-push-action@v6
with:
load: true
push: false
# DISABLED LOAD, THAT IS AN ALIAS FOR type=docker
# load: true
outputs: type=cacheonly
provenance: true
# platforms: amd64,linux/arm64,linux/arm/v7
platforms: amd64
push: ${{ env.ENABLE_PUSH_IMAGE == 'true' }}
target: npm-api-client-fetch-docs
tags: ${{ env.CI_CD_LOCAL_API_NPM_FETCH_DOCS_IMAGE }}
file: "Dockerfile"
tags: ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME_DOCS_NPM_API_CLIENT_FETCH }}:${{ env.IMAGE_TAG }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
6 changes: 2 additions & 4 deletions .github/workflows/generate-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ name: Generate Integrations
on:
push:
branches:
- development
- next

concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
node-version: 22
target-branch: development
target-branch: next
generated-branch: robozinho-do-ladesa/generated-integrations

jobs:
Expand All @@ -32,7 +31,6 @@ jobs:
- name: Install
uses: ./.github/actions/prepare/install
with:
node-version: ${{ env.node-version }}
install-node: "true"

- id: build-integrations
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v4
- name: Install
uses: ./.github/actions/prepare/install
with:
node-version: ${{ env.node-version }}
cache: "pnpm"
install-node: "true"

- name: Install dependencies
run: pnpm install -w --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion api-service/nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"compilerOptions": {
"deleteOutDir": true,
"builder": "swc",
"typeCheck": true
"typeCheck": false
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MigrationInterface, QueryRunner, Table } from "typeorm";

const tableName = "horario_gerado_aul";
const tableName = "horario_gerado_aula";

export class CreateTableHorarioGeradoAula1710196766817 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
Expand Down

0 comments on commit 0d6ee75

Please sign in to comment.