Skip to content

アクセスのない Runtime App を自動で落とせるようにする #910

アクセスのない Runtime App を自動で落とせるようにする

アクセスのない Runtime App を自動で落とせるようにする #910

Workflow file for this run

name: preview
on:
# pull_request_target を使うにあたって https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ の一読を推奨
pull_request_target:
permissions:
packages: write
jobs:
build-dashboard-image:
name: Build Dashboard Image
runs-on: ubuntu-latest
steps:
- name: Set PR_NUMBER env
run: echo "PR_NUMBER=${{ github.event.number }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Builder instance name
run: echo ${{ steps.buildx.outputs.name }}
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: traptitech
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v6
with:
context: dashboard
platforms: linux/amd64,linux/arm64
push: true
# NOTE: once https:/argoproj/argo-cd/pull/13199 is released we can use short sha
tags: ghcr.io/traptitech/ns-dashboard:preview-${{ env.PR_NUMBER }}-${{ github.event.pull_request.head.sha }}
cache-from: type=registry,ref=ghcr.io/traptitech/ns-dashboard:buildcache