Skip to content

deps/2402: part 2

deps/2402: part 2 #45

name: Release without versioning
on:
push:
branches:
- dev
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: write
discussions: read
packages: write
pull-requests: write
repository-projects: write
security-events: read
statuses: write
jobs:
release:
name: Release without versioning
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
if: ${{ github.event_name != 'workflow_dispatch' }}
outputs:
affectedPackages: ${{ steps.affected-packages.outputs.affectPackages }}
environment: ${{ steps.get-deploy-environment.outputs.ENVIRONMENT }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
run_install: false
- name: Install turbo
run: pnpm install --global turbo
- name: Get affected app names
id: affected-apps
run: |
PACKAGES=$(pnpm turbo run build --filter='...[origin/beta]' --dry=json | jq -c '.packages | map(select(. != "//"))')
echo "packages=$PACKAGES" >> $GITHUB_OUTPUT
echo "packages=$PACKAGES"
- name: Generate affected packages
id: affected-packages
run: |
PACKAGES='${{ steps.affected-apps.outputs.packages }}'
PACKAGES_OUTPUT=$(echo $PACKAGES | jq -c 'map_values({name:.,ref:"refs/heads/${{ github.ref_name }}",imageTag:"${{ github.ref_name }}-${{ github.sha }}"})')
echo "affectPackages=$PACKAGES_OUTPUT" >> $GITHUB_OUTPUT
echo "affectPackages=$PACKAGES_OUTPUT"
- name: Get deploy environment
id: get-deploy-environment
run: |
if [[ ${{ github.ref_name }} == "main" ]]; then
echo "Deploy environment is production"
echo "ENVIRONMENT=prod" >> $GITHUB_OUTPUT
elif [[ ${{ github.ref_name }} == "beta" ]]; then
echo "Deploy environment is beta"
echo "ENVIRONMENT=beta" >> $GITHUB_OUTPUT
elif [[ ${{ github.ref_name }} == "dev" ]]; then
echo "Deploy environment is dev"
echo "ENVIRONMENT=dev" >> $GITHUB_OUTPUT
fi
deploy-with-docker:
needs:
- release
uses: ./.github/workflows/deploy-docker.yaml
with:
packages: ${{ needs.release.outputs.affectedPackages }}
environment: ${{ needs.release.outputs.environment }}
container-registry: ghcr.io
image-prefix: thinc-org/cugetreg
gitops-repository: thinc-org/cugetreg-gitops
gitops-ref: master
update-mode: commit
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}