Skip to content

open webuiを追加 #1524

open webuiを追加

open webuiを追加 #1524

Workflow file for this run

name: Staging Deploy
on:
pull_request:
push:
branches:
- main
permissions:
id-token: write
contents: read
pull-requests: read
packages: write
jobs:
filter:
runs-on: ubuntu-latest
outputs:
kube: ${{ steps.path-filter.outputs.kube }}
svcmtr: ${{ steps.path-filter.outputs.svcmtr }}
gcp: ${{ steps.path-filter.outputs.gcp }}
aws: ${{ steps.path-filter.outputs.aws }}
fluxupd: ${{ steps.path-filter.outputs.fluxupd }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: path-filter
with:
filters: |
kube:
- "kubernetes/**"
- ".github/workflows/stg-deploy.yaml"
svcmtr:
- "service-monitor/**"
- ".github/workflows/stg-deploy.yaml"
gcp:
- "gcp/**"
- ".github/workflows/stg-deploy.yaml"
aws:
- "aws/**"
- ".github/workflows/stg-deploy.yaml"
fluxupd:
- "flux-target-updater/**"
- ".github/workflows/stg-deploy.yaml"
kube:
runs-on: ubuntu-latest
needs: filter
environment: staging # 管理者の承認を必要とする
if: needs.filter.outputs.kube == 'true' && github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Deploy
uses: ./.github/actions/kube-deploy-stg
with:
slack-bot-token: ${{ secrets.SLACK_NOTIFIER_TOKEN }}
slack-channel-id: ${{ vars.STG_SLACK_CHANNEL_ID }}
target-branch: ${{ github.head_ref }}
flux-target-updater-token: ${{ secrets.FLUX_TARGET_UPDATER_TOKEN }}
action-link: ${{ github.event.pull_request.html_url }}
kube-main:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.kube == 'true' && github.event_name == 'push' && github.ref_name == 'main'
steps:
- uses: actions/checkout@v4
- name: Deploy
uses: ./.github/actions/kube-deploy-stg
with:
slack-bot-token: ${{ secrets.SLACK_NOTIFIER_TOKEN }}
slack-channel-id: ${{ vars.STG_SLACK_CHANNEL_ID }}
target-branch: main
flux-target-updater-token: ${{ secrets.FLUX_TARGET_UPDATER_TOKEN }}
action-link: ${{ github.event.repository.html_url }}/commit/${{ github.sha }}
service-monitor:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.svcmtr == 'true' && github.event_name == 'pull_request'
environment: staging # 管理者の承認を必要とする
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
uses: ./.github/actions/service-monitor-deploy
with:
func-name: stg-service-monitor
aws-region: ${{ secrets.AWS_REGION }}
aws-update-health-check-arn: ${{ vars.AWS_GITHUB_ACTIONS_ROLE_ARN }}
service-monitor-main:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.svcmtr == 'true' && github.event_name == 'push' && github.ref_name == 'main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
uses: ./.github/actions/service-monitor-deploy
with:
func-name: stg-service-monitor
aws-region: ${{ secrets.AWS_REGION }}
aws-update-health-check-arn: ${{ vars.AWS_GITHUB_ACTIONS_ROLE_ARN }}
fluxupd:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.fluxupd == 'true' && github.event_name == 'pull_request'
environment: staging # 管理者の承認を必要とする
steps:
- name: Get current datetime
run: echo "TIMESTAMP=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Check out
uses: actions/checkout@v4
- name: Deploy
uses: ./.github/actions/fluxupd-deploy
with:
github-actor: ${{ github.actor }}
github-token: ${{ secrets.GITHUB_TOKEN }}
tags: |
ghcr.io/piny940/flux-target-updater:main-${{ github.sha }}-${{ env.TIMESTAMP }}
fluxupd-main:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.fluxupd == 'true' && github.event_name == 'push' && github.ref_name == 'main'
steps:
- name: Get current datetime
run: echo "TIMESTAMP=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Check out
uses: actions/checkout@v4
- name: Deploy
uses: ./.github/actions/fluxupd-deploy
with:
github-actor: ${{ github.actor }}
github-token: ${{ secrets.GITHUB_TOKEN }}
tags: |
ghcr.io/piny940/flux-target-updater:main-${{ github.sha }}-${{ env.TIMESTAMP }}
gcp-apply:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.gcp == 'true' && github.event_name == 'pull_request'
environment: staging # 管理者の承認を必要とする
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Terraform Apply
uses: ./.github/actions/gcp-apply
with:
env: staging
gcp-project: ${{ vars.STG_GCP_PROJECT }}
gcp-project-number: ${{ vars.STG_GCP_PROJECT_NUMBER }}
gcp-apply-main:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.gcp == 'true' && github.event_name == 'push' && github.ref_name == 'main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Terraform Apply
uses: ./.github/actions/gcp-apply
with:
env: staging
gcp-project: ${{ vars.STG_GCP_PROJECT }}
gcp-project-number: ${{ vars.STG_GCP_PROJECT_NUMBER }}
aws-apply:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.aws == 'true' && github.event_name == 'pull_request'
environment: staging # 管理者の承認を必要とする
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Terraform Apply
uses: ./.github/actions/aws-apply
with:
env: "staging"
aws-region: ${{ vars.AWS_REGION }}
aws-role-arn: ${{ vars.AWS_GITHUB_ACTIONS_ROLE_ARN }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
aws-apply-main:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.aws == 'true' && github.event_name == 'push' && github.ref_name == 'main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Terraform Apply
uses: ./.github/actions/aws-apply
with:
env: "staging"
aws-region: ${{ vars.AWS_REGION }}
aws-role-arn: ${{ vars.AWS_GITHUB_ACTIONS_ROLE_ARN }}
gh-token: ${{ secrets.GITHUB_TOKEN }}