Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: introduce nightly build workflow#1941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
samrose merged 1 commit intodevelopfromnightly-build-workflow
Nov 21, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions.github/workflows/base-image-nightly.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
name: Build Base Image Nightly

on:
#schedule:
# - cron: '0 2 * * *' # 2 AM UTC daily
workflow_dispatch:
inputs:
branch:
description: 'Branch to build from'
required: false
default: 'develop'
type: string

permissions:
contents: read
id-token: write

jobs:
build-base-image:
runs-on: blacksmith-4vcpu-ubuntu-2404-arm
timeout-minutes: 150

steps:
- name: Checkout Repo
uses: supabase/postgres/.github/actions/shared-checkout@HEAD
with:
ref: ${{ github.event.inputs.branch || 'develop' }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.DEV_AWS_ROLE }}
aws-region: "us-east-1"
output-credentials: true
role-duration-seconds: 7200

- name: Install nix
uses: cachix/install-nix-action@v27
with:
install_url: https://releases.nixos.org/nix/nix-2.29.1/install
extra_nix_config: |
substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com
trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=

- name: Set execution ID and timestamp
run: |
echo "EXECUTION_ID=${{ github.run_id }}-base-nightly" >> $GITHUB_ENV
echo "BUILD_TIMESTAMP=$(date -u +%Y%m%d-%H%M%S)" >> $GITHUB_ENV

- name: Build base stage 1 AMI
env:
AWS_MAX_ATTEMPTS: 10
AWS_RETRY_MODE: adaptive
run: |
GIT_SHA=${{ github.sha }}
nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl
nix run github:supabase/postgres/${GIT_SHA}#packer -- build \
-var "git-head-version=${GIT_SHA}" \
-var "packer-execution-id=${EXECUTION_ID}" \
-var-file="development-arm.vars.pkr.hcl" \
-var "base-image-nightly=true" \
-var "build-timestamp=${BUILD_TIMESTAMP}" \
-var "region=us-east-1" \
-var 'ami_regions=["us-east-1","ap-southeast-1"]' \
amazon-arm64-nix.pkr.hcl

- name: Slack Notification on Failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }}
SLACK_USERNAME: 'gha-failures-notifier'
SLACK_COLOR: 'danger'
SLACK_MESSAGE: 'Building base image nightly failed'
SLACK_FOOTER: ''

- name: Cleanup resources after build
if: ${{ always() }}
run: |
aws ec2 --region us-east-1 describe-instances --filters "Name=tag:packerExecutionId,Values=${EXECUTION_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --region us-east-1 --instance-ids

- name: Cleanup resources on build cancellation
if: ${{ cancelled() }}
run: |
aws ec2 --region us-east-1 describe-instances --filters "Name=tag:packerExecutionId,Values=${EXECUTION_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --region us-east-1 --instance-ids

[8]ページ先頭

©2009-2025 Movatter.jp