Skip to content

exec it

exec it #416

Workflow file for this run

# Publish subdirectories of this monorepo to standalone repositories
name: publish-repos
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch: # We can trigger the workflow manually
push:
branches:
- main # When we merge to main
- rodrigo/*
tags:
- "**" # If we added a tag (used for releases)
permissions:
contents: write
pull-requests: write
id-token: write # needed to publish images
jobs:
go-tests:
uses: ./.github/workflows/monorepo-go.yml
publish-template-images:
strategy:
matrix:
project_id: [dev-j3tpk] #, nonprod-j3tpk, prod-j3tpk]
template: [python-flask] #template: [deno-fresh, elixir-phoenix, php-laravel, python-flask]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./actions/publish-image
if: ${{ matrix.project_id == 'dev-j3tpk' || github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: $${{ secrets.GITHUB_TOKEN }}
with:
gcp_project: ${{ matrix.project_id }}
template: templates/${{ matrix.template }}
# - uses: webfactory/[email protected]
# if: ${{ matrix.project_id == 'prod-j3tpk' && github.ref == 'refs/heads/main' }}
# with:
# ssh-private-key: ${{ secrets.CODEBOT_SSH_KEY }}
# - uses: ./actions/publish-code
# if: ${{ matrix.project_id == 'prod-j3tpk' && github.ref == 'refs/heads/main' }}
# with:
# origin: ${{ github.repository }}
# targets: >
# templates/${{ matrix.template}}:jetify-examples/${{ matrix.template }}
publish-repos:
# Only publish if tests pass. Right now all tests for all repos need to pass, but as the monorepo
# gets larger, we might want to change this so that we treat each subrepo independently.
needs: go-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.CODEBOT_SSH_KEY }}
- uses: ./actions/publish-code
with:
origin: ${{ github.repository }}
# TODO: consider changing this action so that instead of listing the targets, it
# automatically scans all subdirectories and looks for a config file stating where
# that subdirectory should be published. If the config file lives in the subdir,
# the monorepo can be refactored and publishing still works. As things are today,
# if you relocate a subdirectory within the monorepo, you need to update this
# yaml for things to continue to work.
targets: >
envsec
nixtest
pkg
typeid/typeid
typeid/typeid-go
typeid/typeid-sql
typeid/typeid-js
tyson
create-dependency-update-pr:
needs: publish-repos
runs-on: ubuntu-latest
steps:
- name: Sleep 20s to ensure latest repos get pulled
run: sleep 20s
- name: Checkout Monorepo
uses: actions/checkout@v4
- name: Install devbox
uses: jetify-com/[email protected]
with:
enable-cache: true
- name: Mount golang cache
uses: actions/cache@v4
with:
path: |
~/.cache/golangci-lint
~/.cache/go-build
~/go/pkg
key: ${{ runner.os }}-${{ hashFiles('**/*.sum') }}
- name: Update Dependencies
run: devbox run update-internal-deps
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
title: Update Internal Dependencies
reviewers: 'loreto,mikeland73'
base: main