Skip to content

Release

Release #18

Workflow file for this run

name: Release
on:
workflow_run:
workflows:
- Continuous Integration
branches:
- main
types:
- completed
permissions:
contents: read # for checkout
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
packages: write # to be able to publish to GitHub Packages for Docker images
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'yarn'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Audit dependencies
run: yarn npm audit --severity critical || exit 1
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_NAME: 'Release Bot'
GIT_AUTHOR_EMAIL: 'release-bot@astrolabe-expeditions.org'
GIT_COMMITTER_NAME: 'Release Bot'
GIT_COMMITTER_EMAIL: 'release-bot@astrolabe-expeditions.org'
DOCKER_REGISTRY_USER: ${{ github.actor }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
DATA_INGESTION_WEBHOOK_URL: ${{ secrets.DATA_INGESTION_WEBHOOK_URL }}
run: npx --package semantic-release@25 --package @codedependant/semantic-release-docker semantic-release
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: release
permissions:
contents: read # for checkout
id-token: write # to enable use of OIDC for trusted deployment
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Supabase CLI
uses: supabase/setup-cli@v1
with:
version: latest
- name: Apply Supabase migrations
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}
run: |
supabase link --project-ref $SUPABASE_PROJECT_ID
supabase db push
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Ansible dependencies
run: |
python -m pip install --upgrade pip
pip install -r ansible/requirements.txt
ansible-galaxy collection install -r ansible/requirements.yml
- name: Configure SSH key
run: |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H "${{ secrets.SERVER_IP }}" >> ~/.ssh/known_hosts
- name: Deploy with Ansible
run: ansible-playbook ansible/deploy.yml -i "${{ secrets.SERVER_IP }}," --private-key=~/.ssh/id_ed25519