Skip to content

태그 자동완성 동작 구현 #6191

태그 자동완성 동작 구현

태그 자동완성 동작 구현 #6191

Workflow file for this run

name: Preview
on:
pull_request:
types: [labeled, synchronize]
permissions:
contents: read
id-token: write
jobs:
build-and-deploy:
name: ${{ matrix.app }}
runs-on: ubuntu-latest
if: (github.event.action == 'labeled' && github.event.label.name == 'preview') || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'preview'))
strategy:
fail-fast: false
matrix:
app:
- penxle.com
- penxle.io
- help.penxle.com
concurrency:
group: pr-${{ github.event.pull_request.number }}/${{ matrix.app }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::721144421085:role/actions@github
aws-region: ap-northeast-2
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Generate image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: 721144421085.dkr.ecr.ap-northeast-2.amazonaws.com/${{ matrix.app }}
tags: type=raw,value=pr-${{ github.event.pull_request.number }}
- name: Build image
uses: docker/build-push-action@v5
id: build
with:
push: true
context: .
build-args: |
APP=${{ matrix.app }}
TURBO_TEAM=${{ vars.TURBO_TEAM }}
TURBO_TOKEN=${{ secrets.TURBO_TOKEN }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=721144421085.dkr.ecr.ap-northeast-2.amazonaws.com/${{ matrix.app }}:cache
cache-to: type=registry,ref=721144421085.dkr.ecr.ap-northeast-2.amazonaws.com/${{ matrix.app }}:cache,mode=max,image-manifest=true
provenance: false
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run code generation
working-directory: apps/${{ matrix.app }}
run: pnpm exec turbo run codegen
env:
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
- name: Connect tailnet
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TAILSCALE_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TAILSCALE_OAUTH_CLIENT_SECRET }}
tags: tag:github-actions
- name: Update kubeconfig
run: aws eks update-kubeconfig --name penxle
- name: Apply infrastructure
uses: pulumi/actions@v4
with:
command: up
work-dir: apps/${{ matrix.app }}
stack-name: penxle/pr-${{ github.event.pull_request.number }}
refresh: true
upsert: true
config-map: |
{ "penxle:image.digest": { "value": "${{ steps.build.outputs.digest }}" } }
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
PULUMI_K8S_ENABLE_PATCH_FORCE: 'true'